Extracurricular Sports 题目连接: http://acm.hust.edu.cn/vjudge/contest/122701#problem/D Description As we all know, to pass PE exams, students need to do extracurricular sports, especially jogging. As the result, the Jogging Association in the university…
You are given three integers a, b and x. Your task is to construct a binary string s of length n=a+b such that there are exactly a zeroes, exactly b ones and exactly x indices i (where 1≤i<n) such that si≠si+1. It is guaranteed that the answer always…
2037. Richness of binary words 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=2037 Description For each integer i from 1 to n, you must print a string si of length n consisting of letters 'a' and 'b' only. The string si must contain exactly i dis…
Robot Game 题目连接: http://acm.hust.edu.cn/vjudge/contest/122701#problem/B Description Sgeoghy has addicted herself to an interesting computer game! In this game, she needs to control a robot to pick up a required number of components. There are a lot o…
Minimum palindrome Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 260    Accepted Submission(s): 127 Problem Description Setting password is very important, especially when you have so many "in…
G - Gray CodeTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87643#problem/G Description Denis, Vanya and Fedya gathered at their first team training. Fedya told them that he knew the algorithm for c…
Fractal Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://hihocoder.com/contest/acmicpc2015beijingonline/problem/8 Description This is the logo of PKUACM 2016. More specifically, the logo is generated as follows: 1. Put four points A0(0,0), B0(0,1),…
2045. Richness of words 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=2045 Description For each integer i from 1 to n, you must print a string si of length n consisting of lowercase Latin letters. The string si must contain exactly i distinct pa…
http://acm.hdu.edu.cn/showproblem.php?pid=4731 就做了两道...也就这题还能发博客了...虽然也是水题 先暴力DFS打表找规律...发现4个一组循环节...尾部特殊判断....然后构造一下... #include <cstdio> #include <string> #include <cstdlib> #include <cstring> #include <iostream> #include &…
题目链接 题意 :  给定长度为n的数组a,定义一次操作为: 1. 算出长度为n的数组s,使得si= (a[1] + a[2] + ... + a[i]) mod 1,000,000,007: 2. 执行a = s: 现在问k次操作以后a长什么样. 分析 : 这种不断求前缀和的操作.可以考虑构造操作矩阵.最后矩阵快速幂求答案 设 dp[k][i] 为第 k 次操作.第 i 个数的值 则可以得到递推式 dp[k][1] = dp[k-1][1] dp[k][2] = dp[k-1][2] + dp…