CodeForces 546C Soldier and Cards Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Description Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are d…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are different. They divid…
Description There are n children in Jzzhu's school. Jzzhu is going to give some candies to them. Let's number all the children from 1 to n. The i-th child wants to get at least ai candies. Jzzhu asks children to line up. Initially, the i-th child sta…
Soldier and Cards CodeForces - 546C Two bored soldiers are playing card war. Their card deck consists of exactly ncards, numbered from 1 to n, all values are different. They divide cards between them in some manner, it's possible that they have diffe…
B. Ancient Berland Hieroglyphs 题目连接: http://codeforces.com/problemset/problem/164/B Descriptionww.co Polycarpus enjoys studying Berland hieroglyphs. Once Polycarp got hold of two ancient Berland pictures, on each of which was drawn a circle of hierog…
B. Psychos in a Line Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/319/B Description There are n psychos standing in a line. Each psycho is assigned a unique integer from 1 to n. At each step every psycho who h…
题目链接: http://codeforces.com/contest/6/problem/E E. Exposition time limit per test 1.5 secondsmemory limit per test 64 megabytes 问题描述 There are several days left before the fiftieth birthday of a famous Berland's writer Berlbury. In this connection th…
题目链接:http://codeforces.com/problemset/problem/1029/B 题目大意:从数组a中选出一些数组成数组b,要求 b[i+1]<=b[i]*2 . 一开始想到的是O(n^2)的动态规划,但是超时了,下面是超时的代码. #include <iostream> using namespace std; const int maxn = 200020; int n, a[maxn], f[maxn], res = 0; int main() { cin…
Problem G. Persistent QueueTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88258#problem/G Description Persistent data structures are designed to allow access and modication of any version of data st…
Description Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance between the two farthest of them doesn't e…
题面: Alexandra has a paper strip with n numbers on it. Let's call them ai from left to right. Now Alexandra wants to split it into some pieces (possibly 1). For each piece of strip, it must satisfy: Each piece should contain at least l numbers. The di…
B - Strip 思路:简单dp,用st表+单调队列维护一下. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PII pair<int, int> #define y1 skldjfskldjg #define y2 skldfjsklejg using namespace std; ; ; const int…