题目链接: http://codeforces.com/problemset/problem/864/A

  题目描述: 看不是是不是一串数中只有两种数且这两种数字的数量是相同的

  解题思路: 水题, 水过去

  代码:

#include <iostream>
#include <cstdio>
#include <map>
#include <iterator>
using namespace std;map<int, int > m;
int main() {int n;cin >> n;int cnt = 0;for( int i = 0; i < n; i++ ) {int num;cin >> num;if( m[num] == 0 ) cnt++;m[num]++;}if( cnt == 2 ) {map<int, int>::iterator it;it = m.begin();int temp = it->second;int ans = it->first;it++;if( temp == it->second ) {cout << "YES" << endl;cout << ans << " " << it->first << endl;}else {cout << "NO" << endl;}}else {cout << "NO" << endl;}return 0;
}

View Code

  思考: 十分钟做出来的......读题读了六分钟, 真的菜

http://codeforces.com/problemset/problem/864/A

转载于:https://www.cnblogs.com/FriskyPuppy/p/7599179.html

Codeforces 864 A Fair Game 水题相关推荐

  1. CodeForces - 1141D Colored Boots(暴力+水题)

    题目链接:点击查看 题目大意:给出两个字符串s和t,两个字符串中相同的字母可以匹配,问号可以和任意字符匹配,现在问两个字符串最多能匹配多少个字符,并给出匹配的下标 题目分析:挺好玩的一道水题,大体思路 ...

  2. 【CodeForces - 569B】Inventory (水题)

    题干: Companies always have a lot of equipment, furniture and other things. All of them should be trac ...

  3. codeforces 702A A. Maximum Increase(水题)

    题目链接: A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input sta ...

  4. Codeforces gym 100685 C. Cinderella 水题

    C. Cinderella Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/ ...

  5. codeforces 667A A. Pouring Rain(水题)

    题目链接: A. Pouring Rain time limit per test 1 second memory limit per test 256 megabytes input standar ...

  6. 【CodeForces - 485A】Factory (水题,抽屉原理,tricks)

    题干: One industrial factory is reforming working plan. The director suggested to set a mythical detai ...

  7. CodeForces - 25A IQ test【水题】

    题目链接:https://codeforces.com/contest/25/problem/A #include <iostream> using namespace std; int ...

  8. CodeForces - 29A Spit Problem【水题】

    题目链接:https://codeforces.com/contest/29/problem/A #include <iostream> #include <cstdio> # ...

  9. CodeForces - 29B Traffic Lights【水题】

    题目链接:https://codeforces.com/contest/29/problem/B #include <iostream> #include <cstdio> # ...

最新文章

  1. 什么是Java实例初始化块
  2. python就业方向及工资-Python的就业方向有哪些?
  3. todo项目开发_Facebook的TODO项目,巴西的Coursera,Drupal等
  4. mysql 数据库异常_Mysql连接数据库异常汇总【必收藏】
  5. 关于数据库的设计的一点思路
  6. 关联分析(二)--FP-Growth算法
  7. 介绍几种wifi电源管理模式
  8. Linux命令总结大全,包含所有linux命令
  9. Windows虚拟内存不足问题的处理
  10. 网件rax40可以刷梅林_Netgear 网件 RAX40 AX3000规格 无线路由器 开箱拆解评测
  11. python 使用QPixmap显示图片扭曲、错位问题的解决
  12. 简单的小程序——可操作的表白神器
  13. Aspose.3D使用教程:使用 Java 将 FBX 转换为 RVM 或 RVM 转换为 FBX 文件
  14. 基于Multisim的红路灯电路设计
  15. 目标跟踪(1)基于OpenCV实现单目标跟踪
  16. 前端实现炫酷动感时钟特效
  17. 小C实例也有大梦想——自定义strlen函数
  18. Vite-babysitter 像月嫂?保姆?照顾孩子一般为你讲解Vite源码。
  19. C语言编程题——杨氏矩阵
  20. github国内镜像

热门文章

  1. TensorFlow、Numpy中的axis的理解
  2. JAVA实现合并两个排序的链表(《剑指offer》)
  3. java 工厂模式 计算器_简单工厂模式实现简易计算器
  4. SpaceX再送4人上太空,马斯克保证这次飞船厕所不会漏了
  5. 瘫痪小姐姐“自主”行走视频火了,曾借助轮椅完成舞蹈表演,网友:灵魂是战士...
  6. 都2021年了,输入法还能怎么玩出花?百度智慧输入:toB商业化!
  7. 苹果发布全球首款5nm芯片A14!性能提升40%,新iPad Air率先搭载
  8. 对话高通孟樸:5G发展离不开中国,高通坚定pick全球化
  9. AI正在如何重塑生活和消费?头部企业齐聚,邀你共谈智能产业新机会
  10. 迎接5G普及风暴,还缺这把「万能钥匙」