题目传送门 /* 递推:用cnt记录前缀值,查询区间时,两个区间相减 */ #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> using namespace std; ; const int INF = 0x3f3f3f3f; char s[MAXN]; int cnt[MAXN]; int main(void) //Codeforces Round #186…
B. Ilya and Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ilya the Lion wants to help all his friends with passing exams. They need to solve the following problem to pass the IT…
A. Ilya and Bank Account time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ilya is a very clever lion, he lives in an unusual city ZooVille. In this city all the animals have their rights an…
Codeforces Round #297 (Div. 2)C. Ilya and Sticks Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/C Description In the evening, after the contest Ilya was bored, and he really felt like ma…
题目传送门 /* 题意:给n个棍子,组成的矩形面积和最大,每根棍子可以-1 贪心:排序后,相邻的进行比较,若可以读入x[p++],然后两两相乘相加就可以了 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3f3f; in…
A. Ilya and Bank Account 模拟. B. Ilya and Queries 前缀和. C. Ilya and Matrix 考虑每个元素的贡献. 边长为\(2^n\)时,贡献为最大值: 边长为\(2^{n-1}\)时,贡献为前4大值: 边长为\(2^{n-2}\)时,贡献为前16大值: 以此类推. D. Ilya and Roads \(dp(i,j)\)表示前\(i\)个洞修复了\(j\)个的最小代价. \(dp(i,j)=min\{dp(k,j-(i-k))+c\}\)…
A. Ilya and Diplomas Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/A Description Soon a school Olympiad in Informatics will be held in Berland, n schoolchildren will participate there. At a meeting of the jury…
地址:http://codeforces.com/contest/842/problem/C 题目: C. Ilya And The Tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ilya is very fond of graphs, especially trees. During his last trip…
D. Ilya and Escalator time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ilya got tired of sports programming, left university and got a job in the subway. He was given the task to determine…
纠结的一道dp. 状态转移方程还是比较好想的,优化比较纠结 D. Ilya and Roads time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Everything is great about Ilya's city, except the roads. The thing is, the only ZooVille roa…