Codeforces 379D - New Year Letter】的更多相关文章

原题地址:http://codeforces.com/contest/379/problem/D 题目大意:给出一种生成字符串的方法 s[k] = s[k - 2] + s[k - 1],其中加法意为将左右两个字符串直接相连,要求构造两个长度分别为n.m的字串s[1].s[2],使得按照这种方法得出的s[k]中恰好含有 x 个 “AC”(意思大家都懂的……)如果无解,输出“Happy new year!” 数据范围:3 ≤ k ≤ 50; 0 ≤ x ≤ 109; 1 ≤ n, m ≤ 100…
题目链接:http://codeforces.com/problemset/problem/379/D [题目大意] 告诉你初始字符串S1.S2的长度和递推次数k, 使用类似斐波纳契数列的字符串合并的递推操作,使得最后得到的字符串中刚好含有x个"AC",现在要你构造出满足条件的S1和S2. [分析] 最终结果中有些"AC"可能是应为在合并时一个字符串的尾部和另一个字符串的首部合并而成,这就跟原始字符串的首尾字符有关,不同的情况在K次递推后多产生的"AC&q…
[题目链接]:http://codeforces.com/contest/379/problem/D [题意] 让你构造出两个长度分别为n和m的字符串s[1]和s[2] 然后按照连接的规则,顺序连接s[n-2]和s[n-1]得到s[n] (n>=3) 即s[n] = s[n-2]+s[n-1] 以此规则得到s[k]; 要求s[k]恰好出现x个"AC"子串; [题解] 暴力题; 枚举s1有ac1个"AC"子串,s2有ac2个"AC"子串; 这…
D. New Year Letter time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Many countries have such a New Year or Christmas tradition as writing a letter to Santa including a wish list for presents…
A. Watching a movie time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have decided to watch the best moments of some movie. There are two buttons on your player: Watch the current minute…
http://codeforces.com/problemset/problem/499/B B. Lecture     You have a new professor of graph theory and he speaks very quickly. You come up with the following plan to keep up with his lecture and make notes. You know two languages, and the profess…
问题 A: 剪纸片 时间限制: 1 Sec 内存限制: 128 MB 题目描写叙述 这是一道简单的题目,假如你身边有一张纸.一把剪刀.在H-star的比赛现场,你会这么做: 1. 将这张纸剪成两片(平行于短边剪开): 2. 将当中一片剪成一个圆.作为圆柱的底面. 3. 纸的还有一片的一边沿着圆的周长将圆围起来,直到围成一圈.形成一个无盖的圆柱体. 须要注意的是,纸片可能会有重叠部分. 聪明的你机智的你喜欢思考的你这时候就開始想,一张纸片按上述方式所组成的圆柱的最大体积是多少呢?请你用编程解决问题…
C. Letter Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/180/problem/C Description Patrick has just finished writing a message to his sweetheart Stacey when he noticed that the message didn't look fancy. Patrick was nervou…
A. Letter 题目连接: http://www.codeforces.com/contest/14/problem/A Description A boy Bob likes to draw. Not long ago he bought a rectangular graph (checked) sheet with n rows and m columns. Bob shaded some of the squares on the sheet. Having seen his mas…
枚举开头结尾的字母,枚举ac的个数,总AC个数就是两个Fibonacci数列的和..... D. New Year Letter time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Many countries have such a New Year or Christmas tradition as writing a lett…