E. Okabe and El Psy Kongroo     Okabe likes to take walks but knows that spies from the Organization could be anywhere; that's why he wants to know how many different walks he can take in his city safely. Okabe's city can be represented as all points…
E. Okabe and El Psy Kongroo   Okabe likes to take walks but knows that spies from the Organization could be anywhere; that's why he wants to know how many different walks he can take in his city safely. Okabe's city can be represented as all points (…
E. Okabe and El Psy Kongroo time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Okabe likes to take walks but knows that spies from the Organization could be anywhere; that's why he wants to k…
E. Okabe and El Psy Kongroo time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Okabe likes to take walks but knows that spies from the Organization could be anywhere; that's why he wants to k…
/****************************************************************************************************************** 因为发现不敲题会变蠢...所以没事还是做两道题吧.... 很久没做过题然后发现C和E全都是因为没用LL给卡住了......  我真的是太蠢了 ***************************************************************…
本来打算划划水洗洗睡了,突然听到这次的主人公是冈部伦太郎 石头门(<steins;gate>)主题的比赛,岂有不打之理! 石头门真的很棒啊!人设也好剧情也赞曲子也特别好听. 推荐http://music.163.com/#/m/song?id=26259014&userid=115264555 (强行跑题) Okabe and Future Gadget Laboratory O(n^4)暴力妥妥的 #include<iostream> #include<algori…
题目链接:http://codeforces.com/contest/821/problem/E 题意:我们现在位于(0,0)处,目标是走到(K,0)处.每一次我们都可以从(x,y)走到(x+1,y-1)或者(x+1,y)或者(x+1,y+1)三个位子之一. 现在一共有N段线段,每条线段都是平行于X轴的.我们如果此时x是在这段线段之内的话,我们此时走到的点(x,y)需要满足0<=y<=Ci. 现在保证一段线段的终点,一定是下一段线段的起点.问我们从起点走到终点的行走方案数. 题解:简单的dp+…
题目链接:http://codeforces.com/contest/821/problem/E 题意:起初在(0,0),现在要求走到(k,0),问你存在多少种走法. 其中有n条线段,每条线段为(a,y)->(b,y),代表如果x坐标走到[a,b]之间时,处于的y坐标要小于这个线段的y坐标,就是只能在线段的下方走(包括刚好在线段上),并且前一个段线段的x坐标与后一个线段的x坐标相同. 思路:dp[i][j]代表从起点走到(i,j)时的走法,那么dp[i][j]=dp[i-1][j]+dp[i-1…
E. Sasha and Array 题目连接: http://codeforces.com/contest/719/problem/E Description Sasha has an array of integers a1, a2, ..., an. You have to perform m queries. There might be queries of two types: 1 l r x - increase all integers on the segment from l…
https://codeforces.com/contest/1117/problem/D 题意 有n个特殊宝石(n<=1e18),每个特殊宝石可以分解成m个普通宝石(m<=100),问组成n颗宝石有多少种方法 题解 数据很大:找规律or矩阵快速幂 转移方程: dp[i]=dp[i-1]+dp[i-m] 因为n<=1e18可以用矩阵快速幂 构造矩阵如图: \[ \left[ \begin{matrix} f[i-1] & f[i-2] & \cdots & f[i…