SGU 405 Totalizator
405. Totalizator
Memory limit: 65536
kilobytes
output: standard
Some time ago Vasya was cleaning up the garret. After the hours of hard
work he suddenly found the notes of the totalizator,
which his grandfather had organised during the XII Berland football
championship. It followed from the notes that each participant
of the totalizator made his prediction about the result of every match
(the result of the match is an ordered pair of numbers — number of
goals
scored by the first team and number of goals scored by the second team).
Each prediction is such pair of numbers too. Every participant got
score
for the every prediction he made by the following rules:
- if he guesses the winner (or a tie), his score is inscreased by 2.
- if he guesses the difference between the number of goals scored by the first and the second team, his score is inscreased by 3.
- if he guesses the number of goals scored by the first team, his score is increased by 1.
- if he guesses the number of goals scored by the second team, his score is increased by 1.
So, if the participant guesses the exact result of the match, he gets 7
points. Or, for example, if he guesses only the winner and
the difference, he scores 5 points. Unfortunately, the list with the
results of the totalizator was lost. But Vasya wants
to know how many scores each totalizator participant got. Help him to
find the scores.
The first line contains two integer numbers n and m (1 ≤ n ≤ 100, 1 ≤ m ≤ 100) —
the number of participants and the number of games. After it m blocks of n+1 lines follow. Each block corresponds to one match.
The first line of each block contains two integer numbers a,b (0 ≤ a,b ≤ 10) — numbers of goals scored by the first and
the second team. Other n lines of each block contain predictions of all participants in the same format, the i-th line is a prediction
of the i-th participant.
Output n numbers separated by spaces — scores of participants. The i-th number should be the score of the i-th participant.
Participants are numbered from 1 to n as their predictions are given in the input.
sample input |
sample output |
1 2 |
6 |
sample input |
sample output |
2 3 |
8 6 |
#include<iostream>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<math.h>
#include<vector>
#include<map>
#include<deque>
#include<list>
using namespace std;
int par[];
int main(){
int i,j;
int x,y,giff;
int a,b,diff;
int n,m;scanf("%d%d",&n,&m);
for(i=;i<m;i++){
scanf("%d%d",&a,&b);
diff=a-b;
for(j=;j<=n;j++){
scanf("%d%d",&x,&y);
giff=x-y;
if(diff){if(diff*giff>)par[j]+=;}
else if(!giff)par[j]+=;
if(diff==giff)par[j]+=;
if(x==a)par[j]++;
if(y==b)par[j]++;
}
}
printf("%d",par[]);
for(i=;i<=n;i++)printf(" %d",par[i]);
return ;
}
SGU 405 Totalizator的更多相关文章
- IIS7.5上的REST服务的Put,Delete操作发生HTTP Error 405.0 - Method Not Allowed 解决方法
WebDAV 是超文本传输协议 (HTTP) 的一组扩展,为 Internet 上计算机之间的编辑和文件管理提供了标准.利用这个协议用户可以通过Web进行远程的基本文件操作,如拷贝.移动.删除等.在I ...
- 程序中使用ajax时,type为put,或者delete时在 IIS上没效果,发生HTTP Error 405.0 - Method Not Allowed
其实使用put delete 是在创建webapi中基本才会使用. WebDAV 是超文本传输协议 (HTTP) 的一组扩展,为 Internet 上计算机之间的编辑和文件管理提供了标准.利用这个协 ...
- restful 部署 PUT,DELETE 请求发生405 谓词Http不允许
在部署Restful服务的时候,发现中间有个PUT请求的服务,报405 谓词HTTP 不允许解决方法:卸载WebDav 如果不行可以尝试下另一种方式:
- 使用wcf服务捕捉到“POST http://yourIP/WCFService.svc 405 (Method Not Allowed) ”错误!
在程序中使用了一个wcf服务,调试时无任何问题(win7 64位,iis6.1),发布到部门服务器上没有问题(server2008 64位),但是部署到实际服务器上时(server2008 iis6. ...
- IIS7.5上的REST服务的Put操作发生HTTP Error 405.0 - Method Not Allowed 解决方法
WebDAV 是超文本传输协议 (HTTP) 的一组扩展,为 Internet 上计算机之间的编辑和文件管理提供了标准.利用这个协议用户可以通过Web进行远程的基本文件操作,如拷贝.移动.删除等.在I ...
- HTTP 405 错误 – 方法不被允许 (Method not allowed)
HTTP 协议定义一些方法,以指明为获取客户端(如您的浏览器或我们的 CheckUpDown 机器人)所指定的具体网址资源而需要在 Web 服务器上执行的动作.则这些方法如下: 介绍 OPTIONS( ...
- 解决“HTTP/1.1 405 Method not allowed”问题
Apache.IIS.Nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回"HTTP/1.1 405 Method not allowed"错误. 即,将 ...
- SGU 495. Kids and Prizes
水概率....SGU里难得的水题.... 495. Kids and Prizes Time limit per test: 0.5 second(s)Memory limit: 262144 kil ...
- maven自建仓库 Return code : 405
maven自建仓库jar包上传: jar包上传可以采用在自建仓库上系统上传以及通过配置maven setting.xml以及pom.xml上传. maven通过配置上传需要用户名密码以及maven仓库 ...
随机推荐
- TableView 的那些坑
1. 分割线填满cell宽度, 并且设置分割线的颜色 1.1 利用系统的分割线填充 1.1.1 tableView 设置如下属性 // 给tableView设置如下属性值 tableView.layo ...
- SLF4J multiple
"C:\Program Files\Java\jdk1.8.0_65\bin\java" -Didea.launcher.port=7537 "-Didea.launch ...
- QUnit 实践一
项目准备启用Qunit, 先来尝试一下. 不说废话,上代码: <!DOCTYPE HTML> <html> <head> <meta http-equiv=& ...
- jenkins打包安卓项目
jenkins打包安卓项目和其它项目差不了太多. 1.构建选择 gradle(如果不用gradle自己写脚本编译也可) 2.jenkins用户需要安装JDK.SDK,jenkins会自动下载gradl ...
- java基础57 css样式、选择器和css定位(网页知识)
本文知识点(目录): 1.CSS样式 2.选择器 3.CSS定位 1.CSS样式 1.html 在一个网页中负责的是一个页面的结构 2.css(层叠样式表)在一个页面中负责了一个页面 ...
- tmux 使用
tmux命令参数 tmux new -s name //创建一个新会话 tmux ls //列出所有会话 tmux a -t name //返回某一个会话 tmux内部命令(ctrl+b之后按) s ...
- Elasticsearch doc_value认识
一.doc_value是什么 绝大多数的fields在默认情况下是indexed,因此字段数据是可被搜索的.倒排索引中按照一定顺序存放着terms供搜索,当命中搜索时,返回包含term的documen ...
- 参数化SQL语句
避免SQL注入的方法有两种:一是所有的SQL语句都存放在存储过程中,这样不但可以避免SQL注入,还能提高一些性能,并且存储过程可以由专门的数据库管理员(DBA)编写和集中管理,不过这种做法有时候针对相 ...
- CCF CSP 201503-4 网络延时
CCF计算机职业资格认证考试题解系列文章为meelo原创,请务必以链接形式注明本文地址 CCF CSP 201503-4 网络延时 问题描述 给定一个公司的网络,由n台交换机和m台终端电脑组成,交换机 ...
- Java第三阶段学习(一、IO流------File类)
一.IO概述: 把内存中的数据存入到硬盘(持久化设备)中叫做:输出(写)Output操作.JAVA软件往电脑硬盘上走叫输出. 把硬盘中的数据读取到到内存里叫做:输入(读)Input操作.电脑硬盘上往J ...