2016 ACM/ICPC Asia Regional Dalian Online Football Games
Football Games
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 5055 Accepted Submission(s): 904
At the first phase of the championships, teams are divided into M
groups using the single round robin rule where one and only one game will be played between each pair of teams within each group. The winner of a game scores 2 points, the loser scores 0, when the game is tied both score 1 point. The schedule of these games are unknown, only the scores of each team in each group are available.
When those games finished, some insider revealed that there were some false scores in some groups. This has aroused great concern among the pubic, so the the Association of Credit Management (ACM) asks you to judge which groups' scores must be false.
For each case, the first line contains a positive integers M
, which is the number of groups.
The i
-th of the next M
lines begins with a positive integer Bi
representing the number of teams in the i
-th group, followed by Bi
nonnegative integers representing the score of each team in this group.
number of test cases <= 10
M<= 100
B[i]<= 20000
score of each team <= 20000
lines. Output ``F" (without quotes) if the scores in the i-th group must be false, output ``T" (without quotes) otherwise. See samples for detail.
3 0 5 1
2 1 1
T
/*
两个队踢足球,赢了2分输了0分平了各1分。
给出你最后每个队的得分,问是否合法
瞎搞过的,总得分为场次的2倍,并且得分奇数的个数一定是成对的
*/ #include<iostream>
#include<stdio.h>
#include<string.h>
#include<string>
#include<algorithm>
#include<vector>
#include<map> #define N 100010
#define MAXN 100010 using namespace std;
int main()
{
//freopen("C:\\Users\\acer\\Desktop\\in.txt","r",stdin);
long long m;
long long n,s=,a;
while(scanf("%lld",&m)!=EOF)
{
while(m--)
{
s=;
bool f=;
long long ans=;
scanf("%lld",&n);
for(int i=;i<n;i++)
{
scanf("%lld",&a);
if(a<||a>*(n-)||a>(n*n-n))
{
f=;
//cout<<a<<" 111"<<endl;
}
if(a%)
ans++;
s+=a;
}
if(ans%)
f=;
if(s!=n*n-n)
{
f=;
//cout<<s<<" "<<"222"<<endl;
}
if(f)
puts("F");
else
puts("T");
}
}
return ;
}
2016 ACM/ICPC Asia Regional Dalian Online Football Games的更多相关文章
- HDU 5873 Football Games 【模拟】 (2016 ACM/ICPC Asia Regional Dalian Online)
Football Games Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)To ...
- 2016 ACM/ICPC Asia Regional Dalian Online 1006 /HDU 5873
Football Games Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)To ...
- 2016 ACM/ICPC Asia Regional Dalian Online 1002/HDU 5869
Different GCD Subarray Query Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K ( ...
- HDU 5874 Friends and Enemies 【构造】 (2016 ACM/ICPC Asia Regional Dalian Online)
Friends and Enemies Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Othe ...
- HDU 5875 Function 【倍增】 (2016 ACM/ICPC Asia Regional Dalian Online)
Function Time Limit: 7000/3500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total ...
- HDU 5876 Sparse Graph 【补图最短路 BFS】(2016 ACM/ICPC Asia Regional Dalian Online)
Sparse Graph Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)To ...
- hdu 5868 2016 ACM/ICPC Asia Regional Dalian Online 1001 (burnside引理 polya定理)
Different Circle Permutation Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K ...
- 2016 ACM/ICPC Asia Regional Dalian Online(更新到五道题)
1006 Football Games 这道题输入也很阴险!!! 这道题过题姿势最优雅的,不是if else if else if.那样很容易wa的. 如果没有平手选项, 赢得加一分的话, 可以用La ...
- 2016 ACM/ICPC Asia Regional Dalian Online
1009 Sparse Graph(hdu5876) 由于每条边的权值都为1,所以最短路bfs就够了,只是要求转置图的最短路,所以得用两个set来维护,一个用来存储上次扩散还没访问的点,一个用来存储这 ...
随机推荐
- 翻译 | 使用A-Frame打造WebVR版《我的世界》
原文地址:Minecraft in WebVR with HTML Using A-Frame 原文作者:Kevin Ngo 译者:Felix 校对:阿希 我是 Kevin Ngo,一名就职于 Moz ...
- 移植u-boot-2012.04.01到JZ2440
开发环境:Ubuntu 12.04 开发板:JZ2440 256M NandFlash 64M SDRAM 交叉编译器:arm-linux-gcc-4.3.2 u-boot:u-boot-2012 ...
- clipboard.js 介绍
这是著名开源项目 clipboard.js 的 README.md,我把它翻译成中文.发出来,方便自己和他人阅读. 项目地址:https://github.com/zenorocha/clipboar ...
- 机器学习实战K-近邻算法
今天开始学习机器学习,第一章是K-近邻算法,有不对的地方请指正 大概总结一下近邻算法写分类器步骤: 1. 计算测试数据与已知数据的特征值的距离,离得越近越相似 2. 取距离最近的K个已知数据的所属分类 ...
- Python打印乘法口诀表
思路:第一行:1*1,第二行:1*2.,2*2,第三行:1*3,2*3,3*3-- 最后一行:1*9,2*9,3*9,-9*9,以此类推,可以设2个数:i,j:让 i 从1循环到9,让 j 从1到小于 ...
- Python之scrapy实例1
下文参考:http://www.jb51.net/article/57183.htm 个人也是稍加整理,修改其中的一些错误,这些错误与scrapy版本选择有关,个环境:Win7x64_SP1 + Py ...
- WebApi实现验证授权Token,WebApi生成文档等
using System; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Security; ...
- Windows下编译Python2.7源码
本文开始一个系列文章,深入理解Python源码,算是阅读<Python源码剖析>一书的读书笔记,是一项长期进行的工作.一共分三个部分:Python对象模型,Python虚拟机,Python ...
- WPF DataGrid绑定一个组合列
WPF DataGrid绑定一个组合列 前台: <Page.Resources> <local:InfoConverter x:Key="converter& ...
- eNSP关闭保存文件的提示信息
总是提示如下信息: Oct 12 2017 23:49:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3. ...