CodeForces
来源:互联网 发布:mysql 查询结果存为表 编辑:程序博客网 时间:2024/06/07 05:11
#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <string>#include <cmath>#include <set>#include <map>#include <stack>#include <queue>#include <ctype.h>#include <vector>#include <algorithm>#include <sstream>#define PI acos(-1.0)#define in freopen("in.txt", "r", stdin)#define out freopen("out.txt", "w", stdout)using namespace std;typedef long long ll;const int maxn = 200 + 7, INF = 0x3f3f3f3f, mod = 1e9 + 7;int n;set<int> st;map<int, int> mp;int main() { scanf("%d", &n); for(int i = 0; i < n; ++i) { int x; scanf("%d", &x); st.insert(x); mp[x]++; } if(st.size() != 2) { puts("NO"); return 0; } for(set<int>::iterator it = st.begin(); it != st.end(); ++it) { if(mp[*it] != n/2) { puts("NO"); return 0; } } puts("YES"); set<int>::iterator it = st.begin(); printf("%d ", *it); ++it; printf("%d\n", *it); return 0;}
阅读全文
1 0
- codeforces~~~
- Codeforces
- codeforces
- Codeforces
- codeforces
- codeforces
- Codeforces
- Codeforces
- CodeForces
- CodeForces
- CodeForces
- CodeForces
- CodeForces
- Codeforces
- Codeforces
- Codeforces
- Codeforces
- Codeforces
- 【nginx】负载均衡例子
- 世界上十大数据中心,全球数字经济"顶梁柱"
- 如何解读决策树和随机森林的内部工作机制?
- 漫画 | 小白也能看懂的量子物理漫画终于来了!
- 蒙特卡罗方法入门
- CodeForces
- 我们为什么要学数学?这里给你一个答案。
- 为何美洲蝉中意17这个质数?
- 成为Google认证机器学习工程师,零基础只需要2步?
- 差点令金融世界崩塌的数学公式
- 这几个动图告诉你科学的神奇,看完瞬间觉得智商都提高了
- 阿蒂亚:美妙的数学之梦
- 音乐的数学
- 神奇的“缺8数”