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 水题的更多相关文章

  1. 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 ...

  2. Codeforces Round #379 (Div. 2) B. Anton and Digits 水题

    B. Anton and Digits 题目连接: http://codeforces.com/contest/734/problem/B Description Recently Anton fou ...

  3. 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 ...

  4. 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 ...

  5. Codeforces Round #404 (Div. 2) A - Anton and Polyhedrons 水题

    A - Anton and Polyhedrons 题目连接: http://codeforces.com/contest/785/problem/A Description Anton's favo ...

  6. 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  ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. Myeclipse/eclipse的Web project改写成Maven项目

    1.导入或建立web项目时加上maven的设置 2.加入如下代码:<dependencies>标签下加入红色部分 <dependencies> <dependency&g ...

  2. Win7 64位 VS2013环境编译CGAL-4.7

    看到有人在QQ空间感叹编译CGAL配置折腾了一天时间,自己也想试试,虽然并不打算用,但感觉这库也挺有名的,想必日后用得着,于是着手试着编译. 首先是看一下官网的windows下配置说明 http:// ...

  3. Mysql --分区表(5)Columns分区

    COLUMNS分区 COLUMNS分区是RANGE和LIST分区的变种.COLUMNS分区支持多列作为分区键进行分区 RANGE COLUNMS分区和LIST COLUMNS都支持非INT型列作为分区 ...

  4. media query学习笔记

    原文转自:http://blog.csdn.net/renfufei/article/details/19981133 http://www.cnblogs.com/softlover/archive ...

  5. javascript之观码说理

    前一阶段看到大神在网上贴出的测试个人js理解的代码. 在此我在此借用大神的代码,进行自我复述,大神文章参见:http://www.imooc.com/article/1731 代码1: functio ...

  6. Digit Root ---- 余九定理

    题目:hdu1013, hdu1163, 51nod1116. or dr(n) = (n-1)%9+1. 其中,n-1是为了将结果0-8匹配到1-9. Reference: [1] https:// ...

  7. [Hyper-V]使用操作系统模板创建新的虚拟机

    描述: 为了节省空间和时间的目的,先在Hyper-V里创建一个干净的操作系统,以后再创建虚拟机时都基于此操作系统,节省了安装Windows的时间 另外创建其它虚拟机的时候,也以上述虚拟机的磁盘为基础盘 ...

  8. [异常] VC6.0 error LNK2001: unresolved external symbol _main解决办法

    来自:http://www.douban.com/note/65638800/ 学习VC++时经常会遇到链接错误LNK2001,该错误非常讨厌,因为对于编程者来说,最好改的错误莫过于编译错误,而一般说 ...

  9. SQL Server 2014 安装小记

    一.写在前面 由于想体验下微软的Windows Azure在SQL Server数据库方面的使用,笔者花了点时间安装了一下SQL Server 2014,安装很简单,基本就是稍微做些配置即可,笔者在此 ...

  10. centos 6.5卸载Mysql

    yum remove  mysql mysql-server mysql-libs mysql-server