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 ...
随机推荐
- 数论(poj 1401)
题目:Factorial 题意:求N!末尾的0 的数量. 思路:10 = 2 * 5:N!中的2 的数量肯定比 5多:只需寻找5 的数量,暴力寻找TLE: 快点的方法:f(N) = N/5 + f( ...
- easyUI学习1
panel组件: <div id="p" class="easyui-panel" title="My Panel" style=&q ...
- 在CentOS安装cobbler自动化部署软件
#!/bin/bash##cobbler server addressip=192.168.119.133#DHCP server net and address fanweinet=192.168. ...
- php实现验证码
验证码在表单实现越来越多了,但是用js的写的验证码,总觉得不方便,所以学习了下php实现的验证码.好吧,其实是没有事情干,但是又不想浪费时间,所以学习了下php实现验证码.正所谓,技多不压身.而且 ...
- Java里的构造函数(构造方法)
构造函数 ,是一种特殊的方法.主要用来在创建对象时初始化对象, 即为对象成员变量赋初始值,总与new运算符一起使用在创建对象的语句中.特别的一个类可以有多个构造函数 ,可根据其参数个数的不同或参数类型 ...
- 【08_238】Product of Array Except Self
Product of Array Except Self Total Accepted: 26470 Total Submissions: 66930 Difficulty: Medium Given ...
- SQLServer的Login迁移脚本
背景:公司的数据由SQLServer2008 R2升级至SQLServer2012,并配置了AlwaysOn,本脚本用于将主节点的Login迁移至辅助节点. 1.在主节点执行以下脚本创建存储过程: U ...
- Dynamic CRM 2013学习笔记(三十八)流程1 - 操作(action)开发与配置详解
CRM 2013 里流程有4个类别:操作(action).业务流程(business process flow).对话(dialog)和工作流(workflow).它们都是从 setting –> ...
- kali Linux Web 渗透测试视频教程— 第六课 网络扫描-nmap与zmap
Kali Linux Web 渗透测试视频教程— 第六课 网络扫描-nmap与zmap 文/玄魂 目录 Kali Linux Web 渗透测试视频教程— 第六课 网络扫描-nmap与zmap. 1 N ...
- IE11下Forms身份认证无法保存Cookie的问题
ASP.NET中使用Forms身份认证常见的做法如下: 1. 网站根目录下的Web.config添加authentication节点 <authentication mode="For ...