【链接】 我是链接,点我呀:)

【题意】

在这里输入题意

【题解】

最大值出现次数是偶数。
那么就取次大值。
次大值也是偶数?
=>再次
因为你绝对不能取偶数个的。
取了对方就总是能面对一个奇数的情况了。
则对面总是能拿走最后一个了。

【代码】

#include <bits/stdc++.h>
using namespace std; const int N = 1e5; int n,a[N+10]; int main(){
#ifdef LOCAL_DEFINE
freopen("rush_in.txt", "r", stdin);
#endif
ios::sync_with_stdio(0),cin.tie(0);
cin >> n;
for (int i = 1;i <= n;i++) cin >> a[i];
sort(a+1,a+1+n);
for (int i = n;i>=1;i--){
int j = i;
while (j-1>=1 && a[j-1]==a[i]) j--;
int num = j-i+1;
if (num&1){
return cout<<"Conan"<<endl,0;
}
i = j;
}
cout <<"Agasa"<<endl;
return 0;
}

【Codecraft-18 and Codeforces Round #458 (Div. 1 + Div. 2, combined) B】 Conan and Agasa play a Card Game的更多相关文章

  1. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  2. Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块

    Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块 [Problem Description] ​ ...

  3. Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题

    Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题 [Problem Description] ​ 总共两次询 ...

  4. Educational Codeforces Round 72 (Rated for Div. 2)-D. Coloring Edges-拓扑排序

    Educational Codeforces Round 72 (Rated for Div. 2)-D. Coloring Edges-拓扑排序 [Problem Description] ​ 给你 ...

  5. Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...

  6. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

  7. Educational Codeforces Round 35 (Rated for Div. 2)

    Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...

  8. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...

  9. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...

随机推荐

  1. ES6学习笔记(十三)Iterator遍历器和for...of循环

    1.概念 遍历器(Iterator)就是这样一种机制.它是一种接口,为各种不同的数据结构提供统一的访问机制.任何数据结构只要部署 Iterator 接口,就可以完成遍历操作(即依次处理该数据结构的所有 ...

  2. 通过JMeter来测试Quick Easy FTP Server的上传与下载性能

    FTP性能测试 1.1背景说明 本测试选用的是一个小型的FTP服务器软件:Quick Easy FTP Server.Quick Easy FTP Server是一个全中文的FTP服务器软件,反应迅速 ...

  3. Unity Camera中心点的偏移

    在VR 中,如果镜片的中心轴,和屏幕的中心轴不在一条线上, 就会出现无论如何调节IPD,看到的图像都不清晰,这时候,要修改Camera的投影矩阵, 只需要一句代码就能搞定: Camera.main.p ...

  4. 安装虚拟机(VM)(一)

    原创作品,允许转载,转载时请务必声明作者信息和本声明.  https://www.cnblogs.com/zhu520/p/10728248.html 本人小白,有错指出.谢谢! 一:安装虚拟机前奏 ...

  5. 【Henu ACM Round#19 F】Dispute

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 这一题和这一题很像 (链接 ) 会发现如果a[i]!=b[i]那么就按下i就好了. 然后改变和他相邻的点. 此后a[i]再也不可能和 ...

  6. 一个最不可思议的MySQL死锁分析

    1    死锁问题背景    1 1.1    一个不可思议的死锁    1 1.1.1    初步分析    3 1.2    如何阅读死锁日志    3 2    死锁原因深入剖析    4 2. ...

  7. android自己定义刷新类控件

    android尽管定义了种类很丰富的控件.可是有的时候这些自己定义的控件还是不能满足我的要求,为了可以适配很多其它的需求,我们须要在原有的基础上进行自己定义控件. 今天我向大家介绍的就是android ...

  8. uvalive 4730王国kingdom(并查集+线段树)

     题意:有T组測试数据.每组数据的N表示有N个城市,接下来的N行里每行给出每一个城市的坐标(0<=x,y<=1000000),然后有M(1<M<200000)个操作,操作有 ...

  9. vue24-webpack+vue-loader

    手动配置自己: webpack+vue-loader webpack加载模块 ------------------------------------- 如何运行此项目? 1. npm install ...

  10. JVM-java字符编码

    在JVM内部,所有的字符都是用Unicode编码的.而对于JVM所在操作系统的文件系统,可能有不同的编码类型. 由于JVM和OS文件系统所使用的编码方式不同,JVM在与操作系统进行数据交互的时候,就会 ...