Codeforces Round #313 (Div. 2) C】的更多相关文章

官方英文题解:http://codeforces.com/blog/entry/19237 Problem A: 题目大意: 给出内角和均为120°的六边形的六条边长(均为正整数),求最多能划分成多少个边长为1的正三角形. 题解: 把六边形补全变成一个正三角形,然后减去三个角的正三角形即可. Problem B: 题目大意: 给出长度相等的两个串AB,定义两个串相等 当且仅当  A=B  或者  当长度为偶数时,A[1...n/2]=B[1...n/2]  && A[n/2+1...n]=…
Gerald and Giant Chess Problem's Link: http://codeforces.com/contest/559/problem/C Mean: 一个n*m的网格,让你从左上角走到右下角,有一些点不能经过,问你有多少种方法. analyse: BZOJ上的原题. 首先把坏点和终点以x坐标为第一键值,y坐标为第二键值排序 . 令fi表示从原点不经过任何坏点走到第i个点的个数,那么有DP方程: fi=Cxixi+yi−∑(xj<=xi,yj<=yi)C(xi−xj)…
Equivalent Strings Problem's Link: http://codeforces.com/contest/559/problem/B Mean: 给定两个等长串s1,s2,判断是否等价. 等价的含义为: 若长度为奇数,则必须是相同串. 若长度是偶数,则将两串都均分成长度为原串一半的两个子串l1,r1和l2,r2,其中l1和l2等价且r1和r2等价,或者l1和r2等价且l2和r1等价. analyse: 直接按照题意模拟写个递归分治就行.比赛的时候总觉得这样暴力写会TLE,…
Gerald's Hexagon Problem's Link: http://codeforces.com/contest/559/problem/A Mean: 按顺时针顺序给出一个六边形的各边长(且保证每个内角都是120度),求能够分解成多少个边长为1的小正三角形. analyse: 由于每个内角都是120度,那么把三条边延长相交,一定能够得到一个正三角形. 求出正三角形的面积S1和补上的小三角形的面积S2,则answer=S1-S2. 这里不是真正意义上求正三角形的面积,而是直接求内部可…
B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/560/B Description Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wall. For that he bought…
D. Equivalent Strings Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/problem/B Description Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are…
C. Gerald's Hexagon Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/problem/A Description Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to . Then he me…
A. Currency System in Geraldion Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/560/problem/A Description A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But th…
题目链接:http://codeforces.com/contest/560/problem/E 给你一个n*m的网格,有k个坏点,问你从(1,1)到(n,m)不经过坏点有多少条路径. 先把这些坏点排序一下. dp[i]表示从(1,1)到第i个坏点且不经过其他坏点的路径数目. dp[i] = Lucas(x[i], y[i]) - sum(dp[j]*Lucas(x[i]-x[j], y[i]-x[j])) , x[j] <= x[i] && y[j] <= y[i] //到i…
B. Equivalent Strings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/problem/B Description Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are…