A. Clear Symmetry 题目连接: http://codeforces.com/contest/201/problem/A Description Consider some square matrix A with side n consisting of zeros and ones. There are n rows numbered from 1 to n from top to bottom and n columns numbered from 1 to n from l…
A. LLPS 长度最大10,暴力枚举即可. B. Brand New Easy Problem 枚举\(n\)的全排列,按题意求最小的\(x\),即逆序对个数. C. Clear Symmetry 当\(n\)为偶数时,只有长为\(w=\frac{n}{2}-1\)的正方形内可以填1,并且1不能相邻,根据对称性,1的个数必然是4的倍数,且最大为\[max(\frac{w^2}{2}, w^2-\frac{w^2}{2})\] 当\(n\)为奇数,状压DP,比较麻烦,没想到比较好的实现方式. D…
E. Thoroughly Bureaucratic Organization 题目连接: http://www.codeforces.com/contest/201/problem/E Description Once n people simultaneously signed in to the reception at the recently opened, but already thoroughly bureaucratic organization (abbreviated TB…
D. Brand New Problem 题目连接: http://www.codeforces.com/contest/201/problem/D Description A widely known among some people Belarusian sport programmer Lesha decided to make some money to buy a one square meter larger flat. To do this, he wants to make a…
C. Fragile Bridges 题目连接: http://codeforces.com/contest/201/problem/C Description You are playing a video game and you have just reached the bonus level, where the only possible goal is to score as many points as possible. Being a perfectionist, you'v…
B. Guess That Car! 题目连接: http://codeforces.com/contest/201/problem/B Description A widely known among some people Belarusian sport programmer Yura possesses lots of information about cars. That is why he has been invited to participate in a game show…
题意:给你两个串s,p,问你把s分开顺序不变,能不能用最多k段合成p. 题解:dp[i][j]表示s到了前i项,用了j段的最多能合成p的前缀是哪里,那么转移就是两种,\(dp[i+1][j]=dp[i][j],dp[i+lcp][j+1]=dp[i][j]+lcp\),这里的lcp是dp[i][j]和i的lcp,然后sa预处理一下st表就行了 //#pragma GCC optimize(2) //#pragma GCC optimize(3) //#pragma GCC optimize(4)…
B - Strip 思路:简单dp,用st表+单调队列维护一下. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PII pair<int, int> #define y1 skldjfskldjg #define y2 skldfjsklejg using namespace std; ; ; const int…
题意: 我们在研究罗马数字.罗马数字只有4个字符,I,V,X,L分别代表1,5,10,100.一个罗马数字的值为该数字包含的字符代表数字的和,而与字符的顺序无关.例如XXXV=35,IXI=12. 现在求问一个长度为 nnn 的罗马数字可以有多少种不同的值. n<=109n<=10^9n<=109. 题解: 我们可以用暴力的方法求出前20项的值,其中前111111 项采用打表的方式,而从第12项开始答案始终 = 前一项的答案 + 49,即 292+(n−11)∗49292+(n-11)*…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…