zoj3869 Ace of Aces && zoj3880 Demacia of the Ancients(水)
来源:互联网 发布:淘宝全棉时代有假货吗 编辑:程序博客网 时间:2024/05/01 06:01
做一下去年的省赛吧,虽然分类题感觉自己太渣,但水题不能做不出啊。
本题由于1000的数据量小。所以尽管遍历就好。
#include <stdio.h>#include <algorithm>#include <iostream>#include <queue>#include <string.h>using namespace std;const int N = 5000;const int INF = 1000000;int main(){ // freopen("in.txt", "r", stdin); int T, n, num, a[N], maxx, ans, num0; scanf("%d", &T); while(T --) { scanf("%d", &n); memset(a, 0, sizeof(a)); for(int i = 0; i < n; i ++) { scanf("%d", &num); a[num] ++; } maxx = -INF; ans = 0; for(int i = 0; i < 1005; i ++) if(a[i] > maxx) { maxx = a[i]; num0 = i; } for(int i = 0; i < 1005; i ++) if(a[i] == maxx) ans ++; if(ans == 1) printf("%d\n", num0); else printf("Nobody\n"); } return 0;}
尼玛啊居然有这种烂题,拼手速么
#include <stdio.h>#include <algorithm>#include <iostream>#include <queue>#include <string.h>using namespace std;const int N = 5000;const int INF = 1000000;int main(){ // freopen("in.txt", "r", stdin); int T, n, num, a[N], maxx, ans, num0; scanf("%d", &T); while(T --) { ans = 0; scanf("%d", &n); for(int i = 0; i < n; i ++) { scanf("%d", &num); if(num > 6000) ans ++; } printf("%d\n", ans); } return 0;}
0 0
- zoj3869 Ace of Aces && zoj3880 Demacia of the Ancients(水)
- ZOJ3869 Ace of Aces
- ZOJ3880:Demacia of the Ancients(浙江省赛2015)
- ZOJ3880 Demacia of the Ancients【序列处理+水题】
- Demacia of the Ancients
- ZOJ - 3880 Demacia of the Ancients (水)
- ZOJ3869:Ace of Aces(浙江省赛2015)
- ZOJ3869 Ace of Aces【序列处理】
- zoj 3880 Demacia of the Ancients
- ZOJ 3880 Demacia of the Ancients
- ACM-水题 Demacia of the Ancients
- ZOJ 3880 Demacia of the Ancients
- zoj-3880-Demacia of the Ancients
- ZOJ 3880-Demacia of the Ancients【模拟】
- zoj-3880-Demacia of the Ancients
- 12th浙江省省赛 Demacia of the Ancients(水)
- ZOJ Problem Set - 3880||Demacia of the Ancients
- 第十二届浙江省大学生程序设计大赛-Demacia of the Ancients
- 使用python的PIL库简单的处理图像
- 事务——锁定一行
- matlab中 mcc、mbuild和mex命令详解
- 数据结构triplet
- 最少知识原则
- zoj3869 Ace of Aces && zoj3880 Demacia of the Ancients(水)
- 在IIS上启用Gzip压缩(HTTP压缩)
- leetcode:Same Tree 【Java】
- Doxygen初学与简单应用
- Sqlist
- iis配置php环境
- HTTP协议详解(转)
- pat1018:锤子剪刀布
- hrbust 哈理工oj 2188 星际旅行【BFS+传送阵】