A. Tennis Tournament 题目连接: http://www.codeforces.com/contest/628/problem/A Description A tennis tournament with n participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out. The tourname…
Codeforces Round #549 (Div. 2) B. Nirvana [题目描述] B. Nirvana time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Kurt reaches nirvana when he finds the product of all the digits of some positive int…
题面 D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot…
[题目] C. Smallest Word [描述] IA有一个由若干个'a'和'b'组成的字符串,IA可以翻转该字符串的任意长的前缀,IA想通过这样的操作得到一个字典序最小的字符串,求一种可能的翻转方案.输出是否翻转长度为k的前缀,k=1,2,...,n,n为该字符串长度. 数据范围:1<=字符串长度<=1000 [思路] 为了把第m+1个字符挪到第1个位置并保持其他字符不动,可以翻转m长的和m+1长的前缀(先后顺序不影响结果).于是,我们可以通过这样的操作把每一个'a'挪到最前面,最后就得…
[题目] B. Lost Array [描述] Bajtek有一个数组x[0],x[1],...,x[k-1]但被搞丢了,但他知道另一个n+1长的数组a,有a[0]=0,对i=1,2,...,n.由此可以找到数组x[0],x[1],...,x[k-1]的一些可能情况,即满足这个关系的数组x[0],x[1],...,x[k-1].问一共有多少种可能的数组x[0],x[1],...,x[k-1]的长度k,输出可能的数量以及所有可能的长度k. 数据范围:1<=n<=1000,1<=a[i]&l…