2010-2011 ACM-ICPC, NEERC, Moscow Subregional Contest Problem C. Contest 水题
Problem C. Contest
题目连接:
http://codeforces.com/gym/100714
Description
The second round of the annual student collegiate programming contest is being held in city N. To
be prepared for the inrush of participants, the jury needs to know the number of them attending the
previous, first round.
Unfortunately, the statistics regarding that first round (including the final standings) was lost during a
recent disk failure and no backup was made.
The only hope is a short statistical summary that was found written on a tiny piece of paper by the oldest
jury member. The percentage of teams which have solved the problem is provided for each problem of
the the first round. Each percentage is an integer rounded using the usual mathematical rules (numbers
with a fractional part strictly less than .5 are rounded down, the others are rounded up).
This is the only information the jury has at hand. Also, that oldest jury member clearly remembers that
a prize was awarded to some team during the first round, probably for winning it. Hence, at least one
team had participated in the first round.
Input
The first line of input contains an integer N (3 ≤ N ≤ 12) — the total number of problems in the
contest. The second line of input contains N integers P1, . . . , PN . Each number Pi (0 ≤ Pi ≤ 100)
denotes a percentage of the teams solved the i
th problem.
Output
Print out the minimum possible number of teams that could have participated in the first round.
Sample Input
3
33 67 100
Sample Output
3
Hint
题意
告诉你每道题的过题率,但是都是四舍五入了的。
请你输出最少有多少个队伍参加,才能满足这个过题率。
至少为1个队
题解:
数据范围很小嘛,就暴力枚举人数就好了。
代码
#include <bits/stdc++.h>
using namespace std;
int v[110][110],a[110],n;
int main()
{
//freopen("out.txt","w",stdout);
for(int i=1;i<=100;i++)
{
v[i][0]=1;
for(int j=1;j<=i;j++)
{
double x=j/((double)1.0*i)*(double)100.0;
int y=(int)(x+(double)0.5000000000001);
v[i][y]=1;
}
}
/* for(int i = 1 ; i <= 100 ; ++ i){
for(int j = 1 ; j <= i ; ++ j) printf("%d,%d,%d\n" , i , j , v[i][j]);
}*/
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&a[i]);
for(int i=1;i<=100;i++)
{
int flag=1;
for(int j=1;j<=n;j++)
if(!v[i][a[j]])
{
flag=0;
break;
}
if(flag)
{
printf("%d\n",i);
return 0;
}
}
return 0;
}
2010-2011 ACM-ICPC, NEERC, Moscow Subregional Contest Problem C. Contest 水题的更多相关文章
- ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 G. Garden Gathering
Problem G. Garden Gathering Input file: standard input Output file: standard output Time limit: 3 se ...
- ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 D. Delay Time
Problem D. Delay Time Input file: standard input Output file: standard output Time limit: 1 second M ...
- ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 I. Illegal or Not?
I. Illegal or Not? time limit per test 1 second memory limit per test 512 megabytes input standard i ...
- ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 K. King’s Rout
K. King's Rout time limit per test 4 seconds memory limit per test 512 megabytes input standard inpu ...
- ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 H. Hashing
H. Hashing time limit per test 1 second memory limit per test 512 megabytes input standard input out ...
- ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 C. Colder-Hotter
C. Colder-Hotter time limit per test 1 second memory limit per test 512 megabytes input standard inp ...
- ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 A. Anagrams
A. Anagrams time limit per test 1 second memory limit per test 512 megabytes input standard input ou ...
- 2010-2011 ACM-ICPC, NEERC, Moscow Subregional Contest Problem J. Joke 水题
Problem J. Joke 题目连接: http://codeforces.com/gym/100714 Description The problem is to cut the largest ...
- 2010-2011 ACM-ICPC, NEERC, Moscow Subregional Contest Problem H. Hometask 水题
Problem H. Hometask 题目连接: http://codeforces.com/gym/100714 Description Kolya is still trying to pass ...
- 2018-2019 ICPC, NEERC, Southern Subregional Contest
目录 2018-2019 ICPC, NEERC, Southern Subregional Contest (Codeforces 1070) A.Find a Number(BFS) C.Clou ...
随机推荐
- Sublime Text 2 绿化与汉化 [Windows篇]
其实 ST3 已经出了很久了,可是我这个人恋旧,一直钟爱 ST2,所以就选择她了.最近我的 ST2 越来越卡,甚至有时候输入都会延迟1秒,所以打算自己搞个绿化版. 打开 Sublime Text 官网 ...
- 整理一下原生js的dom操作
获取元素 getElementById() getElementsByClass() getElementsByTagName getElementsByName node属性 前.后.父.子 pre ...
- swift中Any,AnyObject,AnyClass的区别
这几个概念让人很迷惑,看了很多帖子,终于搞明白了,简单总结: Any 和 AnyObject 是 Swift 中两个妥协的产物.什么意思呢,oc中有个id关键字,表示任何对象,oc和swift混编的时 ...
- 第8月第22天 python scrapy
1. cd /Users/temp/Downloads/LagouSpider-master ls ls ls lagou/settings.py cat lagou/settings.py ls p ...
- mongodb导入json文件
mongoimport --db test --collection item --jsonArray item.json
- arm GIC介绍之一【转】
转自:https://blog.csdn.net/sunsissy/article/details/73791470 GIC是ARM架构中及其重要的部分,本文只在公开ARM对应资料基础上,以MTK开发 ...
- ASP.NET MVC + MySQL で開発環境構築
from:http://qiita.com/midori44/items/ef7cdd1d37c353e44b5f ASP.NET MVC & EntityFramework によるコードファ ...
- Laravel Model 的 fillable (白名单)与 guarded (黑名单)
例如 protected $fillable = ['name']; protected $guarded = ['price']; 定义了 name 字段可以写入/修改,而 price 字段不可以. ...
- 【LOJ】#2077. 「JSOI2016」飞机调度
题解 考虑一架飞机飞完自己之后还能飞到哪些航线,用floyd求两点最短路 这个图建出来是个DAG,求最小路径覆盖即可,二分图匹配 注意判断时是航班的起飞时刻+直飞时间+加油时间+最短路时间 代码 #i ...
- js中的prototype原型解析
在典型的面向对象的语言中,如java,都存在类(class)的概念,类就是对象的模板,对象就是类的实例.但是在Javascript语言体系中,是不存在类(Class)的概念的,javascript中不 ...