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数据结构和算法06(红黑树)

    这一篇我们来看看红黑树,首先说一下我啃红黑树的一点想法,刚开始的时候比较蒙,what?这到底是什么鬼啊?还有这种操作?有好久的时间我都缓不过来,直到我玩了两把王者之后回头一看,好像有点儿意思,所以有的 ...

  2. map中使用await 异步函数

    let result=await Promise.all(dataComments.map(async (ele)=>{ return (async ()=>{ let resData= ...

  3. JS权威指南-概述学习

    <script src="/javascripts/application.js" type="text/javascript" charset=&quo ...

  4. Android 验证码倒计时两种方案

    使用 第一种方案:自定义控件 1.在布局中使用 <?xml version="1.0" encoding="utf-8"?> <Relativ ...

  5. 内存泄露--contentView缓存使用与ListView优化

    引起Android内存泄露有很多种原因,下面罗列了一些问题,以后会一一解决 1.构造Adapter时没有使用缓存convertView(衍生出ListView优化问题) 2.查询数据库游标没有关闭 3 ...

  6. 当ThreadLocal碰上线程池

    ThreadLocal使用 ThreadLocal可以让线程拥有本地变量,在web环境中,为了方便代码解耦,我们通常用它来保存上下文信息,然后用一个util类提供访问入口,从controller层到s ...

  7. 推荐一个markdown格式转html格式的开源JavaScript库

    这个markdown格式转html格式的开源JavaScript库在github上的地址: https://github.com/millerblack/markdown-js 从markdown 格 ...

  8. nodejs:遍历文件夹文件统计文件大小

    根据 http://blog.csdn.net/hero82748274/article/details/45700465这里的思路对读写文件做了一个 封装: webpack在打包的时候可以借助ass ...

  9. python_108_格式化字符串format函数

    #通过关键字映射 print('I am {name},age {age}'.format(name='qiqi齐',age=18))#I am qiqi齐,age 18 dictory={'name ...

  10. python-DB模块

    基于python的接口测试框架设计   连接数据库 首先是连接数据库的操作,最好是单独写在一个模块里, 然后便于方便的调用,基于把connection连接放在__init__()方法里 然后分别定义D ...