time limit per test1 second

memory limit per test256 megabytes

inputstandard input

outputstandard output

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

Examples

input

6

ADAAAA

output

Anton

input

7

DDDAADA

output

Danik

input

6

DADADA

output

Friendship

Note

In the first sample, Anton won 6 games, while Danik — only 1. Hence, the answer is “Anton”.

In the second sample, Anton won 3 games and Danik won 4 games, so the answer is “Danik”.

In the third sample, both Anton and Danik won 3 games and the answer is “Friendship”.

【题目链接】:http://codeforces.com/contest/734/problem/A

【题解】



统计一下两个字符出现的次数;

比较大小即可;

好水的题。。

不,这已经水破天际了;

ps:D题手慢了TAT,捶胸顿足状。



【完整代码】

#include <bits/stdc++.h>

using namespace std;

int a[2],n;

int main()
{
cin >> n;
string s;
cin >> s;
for (int i = 0;i <= n-1;i ++)
if (s[i] == 'A')
a[0]++;
else
if (s[i] == 'D')
a[1] ++;
if (a[0] == a[1])
puts("Friendship");
else
if (a[0] > a[1])
puts("Anton");
else
puts("Danik");
return 0;
}

【77.39%】【codeforces 734A】Anton and Danik的更多相关文章

  1. 【35.02%】【codeforces 734A】Vladik and flights

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  2. 【 BowWow and the Timetable CodeForces - 1204A 】【思维】

    题目链接 可以发现 十进制4 对应 二进制100 十进制16 对应 二进制10000 十进制64 对应 二进制1000000 可以发现每多两个零,4的次幂就增加1. 用string读入题目给定的二进制 ...

  3. 【19.77%】【codeforces 570D】Tree Requests

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  4. 【39.66%】【codeforces 740C】Alyona and mex

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  5. 【23.39%】【codeforces 558C】Amr and Chemistry

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  6. 【77.78%】【codeforces 625C】K-special Tables

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  7. 【39.29%】【codeforces 552E】Vanya and Brackets

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  8. 【13.77%】【codeforces 734C】Anton and Making Potions

    time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  9. 【codeforces 750D】New Year and Fireworks

    time limit per test2.5 seconds memory limit per test256 megabytes inputstandard input outputstandard ...

随机推荐

  1. 洛谷——P1598 垂直柱状图

    https://www.luogu.org/problem/show?pid=1598 题目描述 写一个程序从输入文件中去读取四行大写字母(全都是大写的,每行不超过72个字符),然后用柱状图输出每个字 ...

  2. OC中对于属性的总结(@property)

    在没有属性之前: 对成员变量进行改动都要用到设置器:setter来改动 Person *per =[[Person alloc] init]; 对象通过设置器对成员变量内容进行修该 [per setN ...

  3. Loadrunner--基准测试的两种方法

    2 练习基准测试方法1 2.1 问题 为登录业务设计场景. 2.2 方案 在控制台中使用循环多次的方式执行场景.(多次数) 2.3 步骤 实现此案例需要执行以下步骤: 步骤一: 1.打开控制台,如下图 ...

  4. 【Educational Codeforces Round 31 A】Book Reading

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 水模拟 [代码] #include <bits/stdc++.h> using namespace std; const ...

  5. [D3] Select DOM Elements with D3 v4

    Before you can create dazzling data driven documents, you need to know how D3 accesses the DOM. This ...

  6. Android(Lollipop/5.0) Material Design(四) 创建列表和卡片

    Material Design系列 Android(Lollipop/5.0)Material Design(一) 简单介绍 Android(Lollipop/5.0)Material Design( ...

  7. sublime text2 基本配置及结合Python 环境

    参考: http://www.cnblogs.com/figure9/p/sublime-text-complete-guide.html http://www.zhihu.com/question/ ...

  8. 如何调试Javascript代码

    转自原文如何调试Javascript代码 目前,常用的浏览器IE.Chrome.Firefox都有相应的脚本调试功能.作为我们.NET 阵营,学会如何在IE中调试JS就足够了,在掌握了IE中的调试方法 ...

  9. python中有关字符串的处理

    原文 Python 字符串操作(string替换.删除.截取.复制.连接.比较.查找.包含.大小写转换.分割等) 去空格及特殊符号 s.strip().lstrip().rstrip(',') 复制字 ...

  10. BAPC2014 C&amp;&amp;HUNNU11583:Citadel Construction(几何)

    题意: 给出一系列的点,要求寻找最多4个点.使得组成一个面积最大的多边形 思路: 非常显然仅仅有两种情况.要么是三角形,要么是四边形 首先不难想到的是.先要把最外面的点都找出来,事实上就是找凸包 可是 ...