Codeforces Round #379 (Div. 2) A. Anton and Danik 水题
A. Anton and Danik
题目连接:
http://codeforces.com/contest/734/problem/A
Description
Anton likes to play chess, and so does his friend Danik.
Once they have played n games in a row. For each game it's known who was the winner — Anton or Danik. None of the games ended with a tie.
Now Anton wonders, who won more games, he or Danik? Help him determine this.
Input
The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — the number of games played.
The second line contains a string s, consisting of n uppercase English letters 'A' and 'D' — the outcome of each of the games. The i-th character of the string is equal to 'A' if the Anton won the i-th game and 'D' if Danik won the i-th game.
Output
If Anton won more games than Danik, print "Anton" (without quotes) in the only line of the output.
If Danik won more games than Anton, print "Danik" (without quotes) in the only line of the output.
If Anton and Danik won the same number of games, print "Friendship" (without quotes).
Sample Input
6
ADAAAA
Sample Output
Anton
Hint
题意
问你A多,还是D多,然后输出谁赢谁输
题解:
签到题
代码
#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
cin>>s;
cin>>s;
int a=0,b=0;
for(int i=0;i<s.size();i++)
if(s[i]=='A')a++;
else b++;
if(a>b)puts("Anton");
else if(a==b)puts("Friendship");
else puts("Danik");
}
Codeforces Round #379 (Div. 2) A. Anton and Danik 水题的更多相关文章
- Codeforces Round #379 (Div. 2) D. Anton and Chess 水题
D. Anton and Chess 题目连接: http://codeforces.com/contest/734/problem/D Description Anton likes to play ...
- Codeforces Round #379 (Div. 2) B. Anton and Digits 水题
B. Anton and Digits 题目连接: http://codeforces.com/contest/734/problem/B Description Recently Anton fou ...
- Codeforces Round #379 (Div. 2) D. Anton and Chess —— 基础题
题目链接:http://codeforces.com/contest/734/problem/D D. Anton and Chess time limit per test 4 seconds me ...
- Codeforces Round #404 (Div. 2) B. Anton and Classes 水题
B. Anton and Classes 题目连接: http://codeforces.com/contest/785/problem/B Description Anton likes to pl ...
- Codeforces Round #404 (Div. 2) A - Anton and Polyhedrons 水题
A - Anton and Polyhedrons 题目连接: http://codeforces.com/contest/785/problem/A Description Anton's favo ...
- Codeforces Round #297 (Div. 2)A. Vitaliy and Pie 水题
Codeforces Round #297 (Div. 2)A. Vitaliy and Pie Time Limit: 2 Sec Memory Limit: 256 MBSubmit: xxx ...
- Codeforces Round #379 (Div. 2) A B C D 水 二分 模拟
A. Anton and Danik time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- Codeforces Round #290 (Div. 2) A. Fox And Snake 水题
A. Fox And Snake 题目连接: http://codeforces.com/contest/510/problem/A Description Fox Ciel starts to le ...
- Codeforces Round #322 (Div. 2) A. Vasya the Hipster 水题
A. Vasya the Hipster Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/p ...
随机推荐
- tesseract-ocr 出现 错误 Please make sure the TESSDATA_PREFIX environment variable is set to the parent d irectory of your "tessdata" directory.解决方案
简单就是说把tessdata拷贝到exe的所在目录,或者设置TESSDATA_PREFIX环境变量
- Android Studio签名打包的两种方式
签名打包的两种方式: 注:给我们自己开发的app签名,就代表着我自己的版权,以后要进行升级,也必须要使用相同的签名才行.签名就代表着自己的身份(即keystore),多个app可以使用同一个签名. 如 ...
- 取得ascii的例子
取得ascii的例子: String abc = "hello world"; int m = abc.c_str()[0]; ShowMessage(m); i ...
- Windows 7 防火墙对Virtualbox guest的影响
今天测试ASA的public servers配置,在自己的Win7手提用Virtualbox装了个Linux作为测试服务器,网络设置为bridged.从外网可以ping通测试服务器,也可以连80端口, ...
- 一些常用的Bootstrap模板资源站
2013-11-13 23:28:09 超级Bootstrap模板库:http://www.wrapbootstrap.com/ 免费的HTML5 响应式网页模板:http://html5up.n ...
- Android--Activity
1.Activity:它是一种包含用户界面的组件,主要用于和用户进行交互: Activity的用法与步骤: 1)新建类MyActivity.java,继承Activity类: 2)创建布局文件myac ...
- 零配置Socket TCP消息通讯服务容器EC
EC全称是elastic communication,是基于c#实现的Socket网络通讯服务容器,支持windows .Net和mono.通过EC容器可以让开发人员在不了解Socket网络通讯知识和 ...
- Asp.Net Web API 2 官网菜鸟学习系列导航[持续更新中]
详情请查看http://aehyok.com/Blog/Detail/67.html 个人网站地址:aehyok.com QQ 技术群号:206058845,验证码为:aehyok 本文文章链接:ht ...
- Salesforce 快速查看被引入Package的组件
在 Salesforce Package 生成一个新版本的时候,由于经常需要去检查有哪些新的组件将要被引入 Package 中,这个在有众多组件的情况下检查起来会有点眼花缭乱,为了方便,就想着用 JS ...
- 写给自己看的Linux运维基础(二) - Apache/MySQL. 安全设置. 定时任务
本文使用环境为CentOS 6 Apache, PHP, MySQL等常用软件均可通过yum安装包获取 yum install httpd php mysql-server # mysql: 客户端; ...