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千题计划226:bzoj2763: [JLOI2011]飞行路线

    http://www.lydsy.com/JudgeOnline/problem.php?id=2763 这也算分层图最短路? dp[i][j]到城市i,还剩k次免费次数的最短路 #include&l ...

  2. 命令行IRC

    安装客户端irffs sudo apt-get install irssi 登陆服务器 irssi -c irc.freenode.net 设置昵称 /nick <name> 注册或登陆 ...

  3. shape-outside 矩形之外的另一种思路

    http://docs.webplatform.org/wiki/css/properties/shape-outside

  4. lrc歌词文件格式

    一.lrc文件有什么作用 lrc文件就是一个文本文件,用来记录歌曲的歌词信息,使得播放歌曲时能够让歌词与声音同步显示,类似于电影字幕那种效果. 心情很丧时我们会听首歌陶冶一下情操,不知你是否注意过音乐 ...

  5. linux中使用corntab和shell脚本自动备份nginx日志,按天备份

    编写shell脚本,实现nginx日志每天自动备份到指定文件夹! 需要的命令mv , corntab -e(定时任务),shell脚本 这里先说一下corntab: https://www.cnblo ...

  6. mysql innobackupex 备份及恢复

    ----------------------------------全量备份恢复-------------------------------------1.生成一个完整的备份 innobackupe ...

  7. Linux 定时器应用【转】

    Linux 定时器应用 实验目的 阅读 Linux 相关源代码,学习 Linux 系统中的时钟和定时器原理,即,ITIMER_REAL实时计数,ITIMER_VIRTUAL 统计进程在用户模式执行的时 ...

  8. centos6.5安装maridb5.5.51

    1.先创建关于mariadb的yum源 vi /etc/yum.repos.d/MariaDB.repo [mariadb] name = MariaDB baseurl = http://yum.m ...

  9. day25作业

    1.阻塞  2.就绪  3.阻塞  4.Runnable  5.join()  6.synchronized  7.notify()和notifyAll()   8.Object 1.A   2.D  ...

  10. mac OS配置用户全局环境变量(设置字符集为UTF8)

    mac OS系统跟linux系统一样也是将用户的全局环境变量保存在.bash_profile配置文件中,只是mac OS默认没有此文件. 1.创建.bash_profile文件 vi ~/.bash_ ...