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 官网 ...
- J2EE的体系结构是指什么?
J2EE 即Java2平台企业版,它提供了基于组件的方式来设计.开发.组装和部署企业应用.J2EE使用多层分布式的应用模型,这个多层通常通过三层或四层来实现: 客户层,运行在客户计算机上的组件. We ...
- 20155220 2016-2017-2 《Java程序设计》第六周学习总结
20155220 2016-2017-2 <Java程序设计>第六周学习总结 教材学习内容总结 第十章 输入输出 10.1 InputStream OutputStream 数据有来源与目 ...
- Codeforces 237 div2 B. Marathon(关于精度损失的教训)
题目链接:http://codeforces.com/contest/404/problem/B?csrf_token=6292hf3e1h4g5e0d16a996ge6bgcg7g2 解题报告:一个 ...
- ps命令实用方法.ps -l ps -L详解
一.统计sleep状态的进程. c233 plugins # ps -elf|head -1F S UID PID PPID C PRI NI ADDR SZ WCHA ...
- 启动虚拟机报错VMware Workstation cannot connect to the virtual machine
启动虚拟机报错: VMware Workstation cannot connect to the virtual machine. Make sure you have rights to run ...
- android上使用蓝牙设备进行语音输入
主要实现步骤如下:1.确保已经和蓝牙耳机配对连接上.2.开启蓝牙信道AudioManager mAudioManager = (AudioManager)getSystemService(Contex ...
- MCS-51 单片机的中断系统
MCS-51 单片机的中断系统 MCS-51中断系统:5个中断源(两个外部中断, 两个定时器, 一个串口),2个优先级 中断相关概念 中断:当CPU正在处理某件事情时,单片机外部或内部发生的某一紧急事 ...
- 基于Prometheus的Pushgateway实战
一.Pushgateway 简介 Pushgateway 是 Prometheus 生态中一个重要工具,使用它的原因主要是: Prometheus 采用 pull 模式,可能由于不在一个子网或者防火墙 ...
- AndroidManifest.xml配置文件详解 (转)
原文:http://blog.csdn.net/shagoo/article/details/7485958# AndroidManifest.xml配置文件对于Android应用开发来说是非常重要的 ...