BestCoder Round #50 (div.2) 1001
来源:互联网 发布:淘宝要食品流通许可证 编辑:程序博客网 时间:2024/05/22 01:32
Distribution money
Accepts: 713
Submissions: 1881
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
签到题,当前序号下所占的份数大于0.5,则输出该序号,都没有则输出-1
默默地吐槽杭电不支持#include<bits/stdc++.h>
//#include<bits/stdc++.h>#include<cstdio>#include<iostream>using namespace std;int n;struct div{ double b;}ans[10100];int main(){ //freopen("in.txt","r",stdin); while(~scanf("%d",&n)) { int x,count=-1; for(int i=0;i<n;i++) ans[i].b=0; for(int i=0;i<n;i++) { scanf("%d",&x); ans[x].b+=1.0/n; if(ans[x].b>(1.0/2)) count=x; } printf("%d\n",count); } return 0;}
0 0
- BestCoder Round #50 (div.2) 1001
- BestCoder Round #50 (div.2) 1001
- BestCoder Round #50 (div.2)
- BestCoder Round #50 (div.2)
- BestCoder Round 50 (div 2)
- BestCoder Round #50 (div.2)
- #BestCoder Round #50 (div.2)
- BestCoder Round #50 (div.2)
- BestCoder Round #52 (div.2) 1001题
- BestCoder Round #57 (div.2)1001
- BestCoder Round #61 (div.2) 1001
- BestCoder Round #72 (div.2)--1001
- BestCoder Round #81 (div.2):1001 Machine
- BestCoder Round #50 (div.2) 1003
- BestCoder Round #11 (Div. 2)
- BestCoder Round #11 (Div. 2)
- BestCoder Round #54 (div.2)
- BestCoder Round #56 (div.2)
- LeetCode:Two Sum
- 企业讲座
- 企业讲座
- 企业讲座
- C++STL位标志、智能指针与异常处理
- BestCoder Round #50 (div.2) 1001
- python log 日志记录
- 小贝_redis高级应用-发布与订阅
- Database As a Fortress
- 你学会测试了吗(3):测试语法之断言介绍
- 你学会测试了吗(2):测试语法之属性介绍
- Use Uncertainty As a Driver
- 你学会测试了吗(1):推荐工具
- 归并排序MergeSort