D. Marmots (easy)
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Heidi is a statistician to the core, and she likes to study the evolution of marmot populations in each of V(1 ≤ V ≤ 100) villages! So it comes that every spring, when Heidi sees the first snowdrops sprout in the meadows around her barn, she impatiently dons her snowshoes and sets out to the Alps, to welcome her friends the marmots to a new season of thrilling adventures.

Arriving in a village, Heidi asks each and every marmot she comes across for the number of inhabitants of that village. This year, the marmots decide to play an April Fools' joke on Heidi. Instead of consistently providing the exact number of inhabitants P (10 ≤ P ≤ 1000) of the village, they respond with a random non-negative integer k, drawn from one of two types of probability distributions:

  • Poisson (d'avril) distribution: the probability of getting an answer k is  for k = 0, 1, 2, 3, ...,
  • Uniform distribution: the probability of getting an answer k is  for k = 0, 1, 2, ..., 2P.

Heidi collects exactly 250 answers per village. Every village follows either the Poisson or the uniform distribution. Heidi cannot tell marmots apart, so she may query some marmots several times, and each time the marmot will answer with a new number drawn from the village's distribution.

Can you help Heidi to find out whether a village follows a Poisson or a uniform distribution?

Input

The first line of input will contain the number of villages V (1 ≤ V ≤ 100). The following V lines each describe one village. The description of each village consists of 250 space-separated integers k, drawn from one of the above distributions.

Output

Output one line per village, in the same order as provided in the input. The village's line shall state poisson if the village's distribution is of the Poisson type, and uniform if the answer came from a uniform distribution.

Example
input
2
92 100 99 109 93 105 103 106 101 99 ... (input is truncated)
28 180 147 53 84 80 180 85 8 16 ... (input is truncated)
output
poisson
uniform
Note

The full example input is visually represented below, along with the probability distribution function it was drawn from (the y-axis is labeled by its values multiplied by 250).

一道很神奇的水题,泊松分布和方差有关,所以我先找到平均值

他和正态分布是想似的,怎么转换为3西格玛原则呢,就是找到所在位置呗,一半和三分之一还是比较好的,然后这里面的值应该要有比3西格玛中间的数多,随便输了个0.75,蜜汁AC

#include <bits/stdc++.h>
using namespace std;
int main(){
int T;
scanf("%d",&T);
while(T--){
int a[];
int s=;
for(int i=;i<;i++){
scanf("%d",&a[i]);
s+=a[i];
}
double ave=s/250.0;
int cnt=;
for(int i=;i<;i++){
if(fabs(a[i]-ave)<=ave/)
cnt++;
}
if(cnt>*0.75)
puts("poisson");
else
puts("uniform");
}
return ;}

CF802D的更多相关文章

随机推荐

  1. Java 8新特性--Lambda表达式作为返回值

    lambda表达式作为方法的返回值:

  2. NSTimer 实现时钟回调方法

    在开发过程中,发现时钟调用的地方比较多.所以对时钟进行了一个简单的统一封装.具体代码如下: 1.时钟回调函数的声明: #pragma mark 时钟回调处理 //时钟回调 +(NSTimer*) ls ...

  3. webstorm使用总结

    1.webstorm显示ES6语法错误,和nodejs语法错误未提示的问题,只需要在 此处解决ES6语法错误问题: 此处解决不支持node语法的问题: 然后就显示正常啦.

  4. openssl安装介绍

    #因CentOS7默认安装了openssl1.0版本,需要删除该版本,才能安装openssl.1.0.2l版本yum remove -y openssl openssl-devel cd /usr/l ...

  5. Flask应用运行流程

    当我们运行项目后,Flask内部都经历了什么 1.app.run()启动项目,ctrl点进源码 app.py: 1)执行了run_simple() 2)注意第三个参数,这里是Flask实例化的对象,在 ...

  6. NBUT 1118 Marisa's Affair (排序统计,水)

    题意: 每行给出一个人名和一个int值,人名可重复出现.要求对同一个人名统计int值,最大的先输出,若相同,则按照人名出现次数,若再相同,则按照人名字典序. 思路: 输入完全部进行排序,写个比较函数传 ...

  7. X11/extensions/XShm.h: No such file or directory

    CentOS 编译一些开源项目提示:X11/extensions/XShm.h: No such file or directory. 运行命令:yum install libXext-devel就可 ...

  8. 51Nod 1007 正整数分组 -简单DP

    题意: 将一堆正整数分为2组,要求2组的和相差最小. 例如:1 2 3 4 5,将1 2 4分为1组,3 5分为1组,两组和相差1,是所有方案中相差最少的. N<=100 sum<=100 ...

  9. 部署Geoserver tomcat部署geoserver

    1. 下载Geoserver War 包. 2.把geoserver.war文件放到 webapps文件夹下 3.添加Tomcat 用户 解压文件conf文件夹下 修改tomcat-users.xml ...

  10. nginx “403 Forbidden” 错误 解决方法

    错误的原因是缺少index.html或者index.php文件,就是配置文件中index index.html index.htm这行中的指定的文件 只需要配置时加一句  index  index.h ...