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 水题的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

  10. 2018-2019 ICPC, NEERC, Southern Subregional Contest

    目录 2018-2019 ICPC, NEERC, Southern Subregional Contest (Codeforces 1070) A.Find a Number(BFS) C.Clou ...

随机推荐

  1. bzoj千题计划278:bzoj4590: [Shoi2015]自动刷题机

    http://www.lydsy.com/JudgeOnline/problem.php?id=4590 二分 这么道水题 没long long WA了两发,没判-1WA了一发,二分写错WA了一发 最 ...

  2. bzoj千题计划256:bzoj2194: 快速傅立叶之二

    http://www.lydsy.com/JudgeOnline/problem.php?id=2194 相乘两项的下标 的 差相同 那么把某一个反过来就是卷积形式 fft优化 #include< ...

  3. postman断言的几种方式(二)

    1.检查响应体是否包含字符串 pm.test("Body matches string", function () { pm.expect(pm.response.text()). ...

  4. 20155328 2016-2017-2 《Java程序设计》 第8周学习总结

    20155328 2016-2017-2 <Java程序设计> 第8周学习总结 教材学习内容总结 NIO与NIO2 认识NIO 相对于IO,NIO可以让你设定缓冲区容量,在缓冲区中对感兴趣 ...

  5. js星星评分插件

    下载:https://files.cnblogs.com/files/wordblog/%E6%98%9F%E6%98%9F%E6%8F%92%E4%BB%B6.rar

  6. State Estimation for Robotics (Tim Barfoot) exercises Answers

    Here are some exercises answers for State Estimation for Robotics, which I did in June, 2017. The bo ...

  7. Mysql锁机制简单了解一下

    历史文章推荐: 可能是最漂亮的Spring事务管理详解 面试中关于Java虚拟机(jvm)的问题看这篇就够了 Java NIO 概览 关于分布式计算的一些概念 一 锁分类(按照锁的粒度分类) Mysq ...

  8. linux下usb转串口驱动分析【转】

    转自:http://blog.csdn.net/txxm520/article/details/8934706 首先说一下linux的风格,个人理解 1. linux大小结构体其实是面向对象的方法,( ...

  9. mac lsof使用查看端口

    安装 brew install lsof 在Mac OS系统中,无法使用netstat来查看端口占用情况,可以使用lsof来代替,这种方式在Linux下也适用. sudo lsof -nP -iTCP ...

  10. testng运行失败,继续执行

    1.重写断言类 public class Verify { public static StringBuffer verificationErrors= new StringBuffer();; pu ...