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 ...
随机推荐
- 再见Unity3d的死循环
前两天看见http://www.manew.com/thread-89909-1-1.html这篇译文之前几个小时刚好解决了一个莫名的死循环问题,然后忍不住要把另外一种方法告诉蛮友们.这个方法不需要知 ...
- CSS3中:nth-child和:nth-of-type的区别深入理解
关于:nth-child和:nth-of-type的区别之前一直没太注意.最近打算深入了解一些CSS3,才发现里面其实暗藏玄机. :nth-child可以选择父元素下的字元素,:nth-of-type ...
- EditText 焦点
让EditText不自动获取焦点,只需要在EditText的父控件加上 android:focusable="true"android:focusableInTouchMode=& ...
- JS-for中的i
var aBtn = document.getElementsByTagName('input'); for( var i=0; i<aBtn.length; i++ ){ ...
- win7连接共享打印机 错误为
1. xp局域网共享打印机,本机运行 –> \\共享电脑ip –> 选择驱动目录 .INF 文件 –> 确认. 直接报错..... 2. 参考方法: 开始——设备和打印机——添 ...
- java对xml文件做增删改查------摘录
java对xml文件做增删改查 package com.wss; import java.io.File;import java.util.ArrayList;import java.util.Lis ...
- [Leetcode][JAVA] Populating Next Right Pointers in Each Node II
Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tre ...
- day8---多线程socket 编程,tcp粘包处理
复习下socket 编程的步骤: 服务端: 1 声明socket 实例 server = socket.socket() #括号里不写 默认地址簇使用AF_INET 即 IPv4 ...
- ftp客户端命令使用简记
OS:windows8.1评估版 程序和功能 tftp客户端勾选上 Win+R:运行,键入cmd,键入ftp -help 如下图: 使用ftp客户端可以做的事:将文件传送到运行FTP服务器服务(经常称 ...
- Dynamic CRM 2013学习笔记(十七)JS读写各种类型字段方法及技巧
我们经常要对表单里各种类型的字段进行读取或赋值,下面列出各种类型的读写方法及注意事项: 1. lookup 类型 清空值 var state = Xrm.Page.getAttribute(" ...