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. Excel Add-in

    Excel Add-in 前言 这个系列文章应该有一阵子没有更新了,原因是一如既往的多,但是根本所在是我对于某些章节其实还没有完全想好怎么写,尤其是对于Office Add-in这块 —— 到底是要每 ...

  2. 修改IIS7并发连接数目限制

    转自原文 修改IIS7并发连接数目限制 1. 调整IIS 7应用程序池队列长度 由原来的默认1000改为65535. IIS Manager > ApplicationPools > Ad ...

  3. Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument

    spring 5.+jpa 配置类出错: 十二月 20, 2018 5:53:01 下午 org.springframework.web.servlet.DispatcherServlet initS ...

  4. LDD3之并发和竞态-completion(完毕量)的学习和验证

    LDD3之并发和竞态-completion(完毕量)的学习和验证 首先说下測试环境: Linux2.6.32.2 Mini2440开发板 一開始难以理解书上的书面语言,这里<linux中同步样例 ...

  5. DateTime与timeStamp的转换

    DateTime转换为timeStamp: DateTime dt = DateTime.Now;            DateTime startTime = TimeZone.CurrentTi ...

  6. [Recompose] Show a Spinner While a Component is Loading using Recompose

    Learn how to use the 'branch' and 'renderComponent' higher-order components to show a spinner while ...

  7. 用Ajax图片上传、预览、修改图片

    首选图片的上传和下载并不是很难,但要注意细节. 一,给出前端图片上传的html代码 1.图片上传的控件 <img src="/${res}/images/default.png&quo ...

  8. 前端开发必备调试工具(Chrome的F12自带的功能和firebug插件差不多)

    前端开发必备调试工具(Chrome的F12自带的功能和firebug插件差不多) 一.总结 Chrome的F12自带的功能和firebug插件差不多 二.前端开发必备调试工具 在前端开发中我们经常会要 ...

  9. 图像数据的 normalization

    Normalization的方法 matlab 工具函数(三)-- normalize(归一化数据) 1. 加载指定标准差的噪声 im_clean = double(imread('Lena512.p ...

  10. [ExtJS5学习笔记]第九节 Extjs5的mvc与mvvm框架结构简单介绍

    本文地址:http://blog.csdn.net/sushengmiyan/article/details/38537431 本文作者:sushengmiyan ------------------ ...