今天补了下 cf 239div2 顿时信心再度受挫 老子几乎已经木有时间了啊 坐着等死的命.哎!!! 到现在还只能做大众题,打铁都不行. 每次D题都是有思路敲错,尼玛不带这么坑爹的. 哎!不写了,写这个也是浪费时间,还不如去睡觉了呢. 就这样吧.…
题目链接:http://codeforces.com/contest/407/problem/C 题目大意:给一个长度为n的数列,m次操作,每次操作由(li, ri, ki)描述,表示在数列li到ri这段数字上分别加上C(j-li+ki, ki),要求输出最后得到的序列.(% 1e9+7) 数据范围:1<=n, m<=10^5, a[i]<=10^9 思路:区间上加一个函数,在线求和,这种题目之前遇到过.记得是在区间上加kd(l<=k<=r),解法是线段树处理,由于等差+等差…
做了三个题,先贴一下代码...终于涨分了 A. Line to Cashier 水题 #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <algorithm> using namespace std; <<); int main() { ], ans; int i, j;…
C - Curious Array 思路:对于区间[l, r]每个数加上C(i - l + k, k), 可以在l处+1, 在r+1处-1, 然后做k+1次求前缀和操作,然后就可以写啦. 然后逐层求前缀和的时候r+1上都要减去一个组合数. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PII pair<int, int…
time limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard output There is a right triangle with legs of length a and b. Your task is to determine whether it is possible to locate the triangle on the plane in s…
B. Long Path time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day, little Vasya found himself in a maze consisting of (n + 1) rooms, numbered from 1 to (n + 1). Initially, Vasya is at th…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] DP,设f[i]表示第一次到i这个房间的时候传送的次数. f[1] = 0,f[2] = 2 考虑第i个位置的情况. 它肯定是从i-1这个位置走过来的. 但是第一次走到i-1这个位置的时候. 需要再走回p[i-1],然后回到i-1才能再走到i 其实这个时候走到p[i-1]的时候,我们就和第一次走到p[i-1]的时候是一样的. 因此再从p[i-1]走到i-1的话. 它的移动次数就等于f[i-1]-f[p[i-1]] 那么 f[i]…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 最后的直角三角形可以通过平移,将直角顶点移动到坐标原点. 然后我们只要枚举另外两个点其中一个点的坐标就好了. x坐标的范围是[1..a) 因为再长的话,这条边肯定就超过边长a了. 然后用一些相似三角形的规律就能知道另外一个点的坐标了. 看看这两个点的y坐标是不是一样就好. [代码] #include <bits/stdc++.h> using namespace std; int a,b; int main(){ #ifdef…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/output 1 s, 256 MB  x2377 B Queue standard input/output 2 s, 256 MB  x1250 C Hacking Cypher standard input/output 1 s, 256 MB  x740 D Chocolate standard in…
 cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....       其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…