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. POJ 2932 圆扫描线

    求n个圆中没有被包含的圆.模仿扫描线从左往右扫,到左边界此时如有3个交点,则有3种情况,以此判定该圆是否被离它最近的圆包含,而交点和最近的圆可以用以y高度排序的Set来维护.因此每次到左边界插入该圆, ...

  2. elementUI 表格分页后台排序记录

    表格代码 <div class="m-table"> <el-table :data="logs" style="width: 10 ...

  3. 一致性哈希算法介绍,及java实现

    应用场景 在做服务器负载均衡时候可供选择的负载均衡的算法有很多,包括: 轮循算法(Round Robin).哈希算法(HASH).最少连接算法(Least Connection).响应速度算法(Res ...

  4. C根据排序字符串

    #include<stdio.h> #include<string.h> #include <stdlib.h> #define STR_LEN_MAX 100 c ...

  5. 20165230 ch02 课上测试

    题目一 1.参考附图代码,编写一个程序 "week0201学号.c",判断一下你的电脑是大端还是小端. 2.提交运行结果"学号XXXX的笔记本电脑是X端"的运行 ...

  6. 20165230 《Java程序设计》实验五《网络编程与安全》实验报告

    20165230 <Java程序设计>实验五<网络编程与安全>实验报告 一.实验报告封面 课程:Java程序设计 班级:1652班 姓名:田坤烨 学号:20165230 成绩: ...

  7. JVM 垃圾回收算法及案例分析

    一. 在说垃圾回收算法之前,先谈谈JVM怎样确定哪些对象是“垃圾”. 1.引用计数器算法: 引用计数器算法是给每个对象设置一个计数器,当有地方引用这个对象的时候,计数器+1,当引用失效的时候,计数器- ...

  8. C# 特性(Attribute)详细介绍

    1.什么是Atrribute 首先,我们肯定Attribute是一个类,下面是msdn文档对它的描述:公共语言运行时允许你添加类似关键字的描述声明,叫做attributes, 它对程序中的元素进行标注 ...

  9. cas:覆盖安装

    1.首先到github上下载最新的模板代码 https://github.com/apereo/cas-overlay-template 下载完成后,导入该工程. 2.编译打包 cd cas-over ...

  10. 测试开发之Django——No4.Django中前端框架的配置与添加

    我们在开发一个web项目的时候,虽然我们不是专业开发,但是我们也想要做出来一个美美的前端页面. 这种时候,百度上铺天盖地的前端框架就是我们的最好选择了. 当然,在网上直接下载的框架,我们是不能直接用的 ...