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

http://codeforces.com/contest/456/problem/A A. Laptops time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day Dima and Alex had an argument about the price and quality of laptops. Dima thi…
题目传送门 /* 题意:选择a[k]然后a[k]-1和a[k]+1的全部删除,得到点数a[k],问最大点数 DP:状态转移方程:dp[i] = max (dp[i-1], dp[i-2] + (ll) i * cnt[i]); 只和x-1,x-2有关,和顺序无关,x-1不取,x-2取那么累加相同的值,ans = dp[mx] */ #include <cstdio> #include <algorithm> #include <cstring> #include <…
题目传送门 /* DP:从1到最大值,dp[i][1/0] 选或不选,递推更新最大值 */ #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3f3f; ll dp[MAXN][]; ll cnt[MAXN]; ll work(…
Codeforces Round #713 (Div. 3) Editorial 记录一下自己写的前二题本人比较菜 A. Spy Detected! You are given an array a consisting of n (n≥3) positive integers. It is known that in this array, all the numbers except one are the same (for example, in the array [4,11,4,4]…
链接:http://codeforces.com/contest/454/problem/A A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a crystal from the Crystal Mine. A c…
D. Serega and Fun Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/455/problem/D Description Serega loves fun. However, everyone has fun in the unique manner. Serega has fun by solving query problems. One day Fedor came up w…
C. Civilization Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/455/problem/C Description Andrew plays a game called "Civilization". Dima helps him. The game has n cities and m bidirectional roads. The cities are numbe…
A. Boredom Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/455/problem/A Description Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and d…
题目链接:http://codeforces.com/problemset/problem/455/A 给你n个数,要是其中取一个大小为x的数,那x+1和x-1都不能取了,问你最后取完最大的和是多少. 简单dp,dp[i]表示取i时zui最大和为多少,方程为dp[i] = max(dp[i - 1] , dp[i - 2] + cont[i]*i). #include <bits/stdc++.h> using namespace std; typedef __int64 LL; ; LL a…
A:    http://codeforces.com/contest/1157/problem/A 题意:每次加到10的整数倍之后,去掉后面的0,问最多有多少种可能. #include <iostream> #include <algorithm> #include <vector> #include <string> #include <set> using namespace std; int main() { ios::sync_with…