Codeforces Round #239 (Div. 1)C, 407C】的更多相关文章

题目链接: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. Straight «A» time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Noora is a student of one famous high school. It's her final year in school — she is going to study in university next year.…
A. Key races 题目链接:http://codeforces.com/contest/835/problem/A 题目意思:两个比赛打字,每个人有两个参数v和t,v秒表示他打每个字需要多久时间,等这个这个字传递过去需要t秒,而且在打第一个字之前也会有一个反应时间t.问第一个人可不可以获胜. 题目思路:这个题目当时题目没读懂,明白之后就是一个非常简单的题目了. (s*v1+2*t1)<(s*v2+2*t2)第一个人就可以获胜 (s*v1+2*t1)==(s*v2+2*t2) 就会平局,否…
做了三个题,先贴一下代码...终于涨分了 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;…
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…
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…
A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed…
A. Meeting of Old Friends time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Today an outstanding event is going to happen in the forest — hedgehog Filya will come to his old fried Sonya! Sony…
今天补了下 cf 239div2 顿时信心再度受挫 老子几乎已经木有时间了啊 坐着等死的命.哎!!! 到现在还只能做大众题,打铁都不行. 每次D题都是有思路敲错,尼玛不带这么坑爹的. 哎!不写了,写这个也是浪费时间,还不如去睡觉了呢. 就这样吧.…
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…