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");
}

转载于:https://www.cnblogs.com/qscqesze/p/6069099.html

Codeforces Round #379 (Div. 2) A. Anton and Danik 水题相关推荐

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

  2. Codeforces Round #379 (Div. 2) E. Anton and Tree —— 缩点 + 树上最长路

    题目链接:http://codeforces.com/contest/734/problem/E E. Anton and Tree time limit per test 3 seconds mem ...

  3. Codeforces Round #379 (Div. 2) E. Anton and Tree

    题意: 给一颗树 每个节点有黑白2色 可以使一个色块同事变色,问最少的变色次数. 思路: 先缩点 把一样颜色的相邻点 缩成一个 然后新的树 刚好每一层是一个颜色. 最后的答案就是树的直径/2 不过我用 ...

  4. Codeforces Round #370 (Div. 2) A. Memory and Crow 水题

    A. Memory and Crow 题目连接: http://codeforces.com/contest/712/problem/A Description There are n integer ...

  5. Codeforces Round #311 (Div. 2) A. Ilya and Diplomas 水题

    A. Ilya and Diplomas Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/ ...

  6. Codeforces Round #394 (Div. 2) A. Dasha and Stairs 水题

    A. Dasha and Stairs 题目连接: http://codeforces.com/contest/761/problem/A Description On her way to prog ...

  7. Codeforces Round #374 (Div. 2) A. One-dimensional Japanese Crosswor 水题

    A. One-dimensional Japanese Crossword 题目连接: http://codeforces.com/contest/721/problem/A Description ...

  8. Codeforces Round #358 (Div. 2) A. Alyona and Numbers 水题

    A. Alyona and Numbers 题目连接: http://www.codeforces.com/contest/682/problem/A Description After finish ...

  9. Codeforces Round #307 (Div. 2) A. GukiZ and Contest 水题

    A. GukiZ and Contest Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/551/ ...

最新文章

  1. python 判断字符串是否以数字结尾
  2. 1803无法升级到2004_Win10再度误伤“友军”:升级五月更新后OneDrive同步报错
  3. python凯撒密码详解_Python基础题目集--课堂案例
  4. 适合零基础学python的书籍_适合零基础学习Python的书籍
  5. mysql 逻辑型_17. 逻辑运算符
  6. tf.Session().as_default的作用
  7. 华为成为全球领先的移动设备供应商
  8. Mybatis映射文件动态SQL语句-02
  9. 页面传值:属性,协议,Block传值
  10. 记一次Sentry部署过程
  11. C语言模拟实现标准库函数之strcpy()
  12. Leetcode PHP题解--D68 283. Move Zeroes
  13. Python《第一次爬虫遭遇反盗链(上)》
  14. 1、.Net Core 基础
  15. java 自动生成mybatis文件_如何自动生成Mybatis的Mapper文件详解
  16. 【解决方案】pytorch中loss变成了nan | 神经网络输出nan | MSE 梯度爆炸/梯度消失
  17. 【ms access】SQL 引用外部表
  18. Undefined exploded archive location(在myeclipse中TOMCAT不能发布程序。)
  19. 路由器需要多大内存?
  20. 【MOOC】华中科技大学计算机组成原理慕课答案-第二章-数据表示

热门文章

  1. 蓝桥杯java 大纲,2019 第十届蓝桥杯Java省赛B组个人总结
  2. CSS百分比实现高度占位自适应
  3. angularJs的spa页面切换以及ngRoute模块
  4. java url压缩_URL短地址压缩算法 微博短地址原理解析 (Java实现)
  5. p70_域名解析系统DNS
  6. OpenGL基础36:天空盒
  7. bzoj 1685: [Usaco2005 Oct]Allowance 津贴(贪心)
  8. Java 一个简单的绘制类似花瓣的程序
  9. paper reading:[第一代GCN] Spectral Networks and Deep Locally Connected Networks on Graphs
  10. [Python] np.ones_like(ndarray)和np.zeros_like(ndarray)