Codeforces 864AFair Game(水)
来源:互联网 发布:黑色沙漠捏脸数据下载 编辑:程序博客网 时间:2024/05/24 01:22
水题,数据小随意实现
判断有几种数,两种的话判断出现次数是否相同就好了
代码
#include <iostream>#include <cstdio>#include<cstring>#include <algorithm>#include<set>using namespace std;int num[105];set<int>cards;set<int>::iterator it;int main(){ int T,N,temp; while(~scanf("%d",&N)) { memset(num,0,sizeof num); cards.clear(); for(int i=0;i<N;i++) { scanf("%d",&temp); cards.insert(temp); num[temp]++; } if(cards.size()!=2) printf("NO\n"); else { it=cards.begin(); int n1=*it; int temp1=num[n1]; it++; int n2=*it; int temp2=num[n2]; if(temp1!=temp2) printf("NO\n"); else { printf("YES\n"); printf("%d %d\n",n1,n2); } } } return 0;}
阅读全文
0 0
- Codeforces 864AFair Game(水)
- CodeForces - 630R Game (规律)水
- 【CodeForces 570B】Simple Game(水)
- CodeForces 864A Fair Game
- CodeForces 630R:Game【水】
- Flipping Game(Codeforces)(枚举)
- 【Codeforces Round】351A - Bear and Game(水)
- CodeForces - 670B Game of Robots (模拟)水
- CodeForces - 673A Bear and Game (模拟)水
- 【Codeforces】-703A-Mishka and Game(水)
- CodeForces 833 A.The Meaningless Game(水~)
- (数学水题)Codeforces A. Kirill And The Game
- codeforces 864A 之 Fair Game
- codeforces 703 A. Mishka and Game (水)
- codeforces-#468A. 24 Game(构造)
- codeforces 496D Tennis Game(枚举)
- Codeforces 570 B. Simple Game ( 概率 )
- codeforces - 578B - "Or" Game(模拟)
- Delete Node In A LinkedList
- JZOJ 5385. 【NOIP2017提高A组模拟9.23】Carry
- maven项目配置
- 关于JavaScript中this的一些理解
- 4.打地鼠实现
- Codeforces 864AFair Game(水)
- Ubuntu离线安装cuda,cudnn,caffe,opencv
- 基本信号处理
- python-----贪心
- 数据结构实验之栈与队列二:一般算术表达式转换成后缀式
- CentOS7版Linux系统安装mysql详细步骤及问题(亲测通过)
- 单例(Singleton)设计模式
- Spring学习(五):自动化装配Bean
- A