C - Anton and Danik】的更多相关文章

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 th…
Problem 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 gam…
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 - An…
本蒟蒻闲来无事刷刷水题 话说这道题,看楼下的大佬们基本都是用字符 ( char ) 来做的,那么我来介绍一下C++的优势: string ! string,也就是类型串,是C语言没有的,使用十分方便 我来介绍一下string的用法: 1.定义 string 字符串名; 2.输入 它有 2 种输入方式: ① getline\color{black}\text{getline}getline :使用方法: getline(cin,字符串名); ② cin\color{black}\text{cin}…
A. Anton and Danik time limit per test 1 second memory limit per test 256 megabytes input standard input output standard 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…
A.Anton and Danik Problems: 给你长度为N的,只含'A','D'的序列,统计并输出何者出现的较多,相同为"Friendship" Analysis: lucky_ji: 水题,模拟统计A和D的数目比较大小输出结果即可 Tags: Implementation B.Anton and Digits Problems: 给定k2个2,k3个3,k5个5及k6个6,可以组成若干个32或256,求所有方案中Sigma的最大值 Analysis: lucky_ji: 同…
上次,我在" Anton And Danik "中为大家介绍了 string 的部分用法 今天,我就再来为大家介绍一下 string 的其他用法 : ( 有可能已经讲过了,不要介意 ) 1 . 定义 假设你想定义的字符串变量名字为 s ,那么就像下面一样定义 : string s; 而且,字符串还可以像数组一样定义: #define maxn 100010//定义元素个数的最大值,这里 maxn 为 100010 string s[maxn]; 或者直接 string s[100010…
C. Anton and Fairy Tale 题目连接: http://codeforces.com/contest/785/problem/C Description Anton likes to listen to fairy tales, especially when Danik, Anton's best friend, tells them. Right now Danik tells Anton a fairy tale: "Once upon a time, there liv…
E. Anton and Tree time limit per test: 3 seconds memory limit per test :256 megabytes input:standard input output: standard output Anton is growing a tree in his garden. In case you forgot, the tree is a connected acyclic undirected graph. There are …
题目传送门 /* 题意:从前面找一个数字和末尾数字调换使得变成偶数且为最大 贪心:考虑两种情况:1. 有偶数且比末尾数字大(flag标记):2. 有偶数但都比末尾数字小(x位置标记) 仿照别人写的,再看自己的代码发现有清晰的思维是多重要 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #include <cstring> #include…