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. 微信支付v2开发(7) 告警通知

    本文介绍微信支付中如何获得告警通知. 一.告警通知 为了及时通知商户异常,提高商户在微信平台的服务质量.微信后台会向商户推送告警通知,包括发货延迟.调用失败.通知失败等情况,通知的地址是商户在申请支付 ...

  2. python3 pygame 坦克自动移动

    让坦克自动跑起来 这里需要一个坦克的图. 放到与脚本同一目录. 好,我们就让这个坦克自动跑. 下面上代码: # !/usr/bin/env python # -*- coding:utf-8 -*- ...

  3. LA 3644 - X-Plosives ( 也即UVA 1160)

    LA看题 请点击:传送门 UVA 上也有这题 :UVA 1160 - X-Plosives 题目大意就是如果车上存在 k 个简单化合物,正好包含 k 种元素 ,那么它们将有危险,此时你应该拒绝装车. ...

  4. md5解密猜想

    md5解密猜想 一.总结 一句话总结:可以用有技巧性(常用密码,相关信息)的暴力破解. 二.md5解密猜想 1.暴力破解 其实md5也是由那些常用的字符串组组成的32位密文,所以可以把那些常用字符串( ...

  5. 【Android开源框架】使用andbase开发框架实现绘制折线图

    在Android中,当有绘制折线图的需求时.大多数人使用的AChartEngine,来进行折线图的绘制.AChartEngine图表引擎确实能够实现折线图的功能.除此之外,我们还能够使用andbase ...

  6. swift学习第十五天:闭包

    闭包 闭包的介绍 闭包和OC中的block非常相似 OC中的block是匿名的函数 Swift中的闭包是一个特殊的函数 block和闭包都经常用于回调 注意:闭包和block一样,第一次使用时可能不习 ...

  7. Unity中做放大镜 效果

    孙广东  2015.8.16 事实上和 小地图都几乎相同了. 还是要借助 还有一个相机 目的: 这篇文章的主要目的是  要给你一个想法  怎样做放大境效果 . 在unity中能够简单的实现放大镜效果啊 ...

  8. 如何在hadoop中控制map的个数 分类: A1_HADOOP 2015-03-13 20:53 86人阅读 评论(0) 收藏

    hadooop提供了一个设置map个数的参数mapred.map.tasks,我们可以通过这个参数来控制map的个数.但是通过这种方式设置map的个数,并不是每次都有效的.原因是mapred.map. ...

  9. Java中的日期操作 分类: B1_JAVA 2015-02-16 17:55 6014人阅读 评论(0) 收藏

    在日志中常用的记录当前时间及程序运行时长的方法: public void inject(Path urlDir) throws Exception { SimpleDateFormat sdf = n ...

  10. 如何知道刚刚插入数据库那条数据的id

    如何知道刚刚插入数据库那条数据的id 一.总结 一句话总结:这些常见功能各个框架里面都有,可以查看手册,thinkphp里面是$userId = Db::name('user')->getLas ...