Berland starts to seize the initiative on the war with Flatland. To drive the enemy from their native land, the berlanders need to know exactly how many more flatland soldiers are left in the enemy's reserve. Fortunately, the scouts captured an enemy…
双指针. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; +; int n,k,a[maxn],b[maxn]; int cnt[maxn]; int get(int val) { ,r=n; ; while(l<=r) { ; ; ; ; } return pos; } int main() { scanf(&quo…
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 exceed d. Not…
[Codeforces]1263A Sweet Problem [Codeforces]1263B PIN Code [Codeforces]1263C Everyone is a Winner! [Codeforces]1263D Secret Passwords [Codeforces]1263E Editor…
Hacking Cypher Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 490C Description Polycarpus participates in a competition for hacking into a new secure messenger. He's almost won. Having…
Secret Combination Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 496B Description You got a box with a combination lock. The lock has a display showing n digits. There are two buttons…
C. Hacking Cypher time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarpus participates in a competition for hacking into a new secure messenger. He's almost won. Having carefully studied…
题目连接:http://codeforces.com/contest/757/problem/D D. Felicity's Big Secret Revealed time limit per test 4 seconds memory limit per test 512 megabytes input standard input output standard output The gym leaders were fascinated by the evolutions which t…
题目链接 C. Hacking Cyphertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarpus participates in a competition for hacking into a new secure messenger. He's almost won. Having carefully studied the…
题目传送门 /* 构造+暴力:按照题目意思,只要10次加1就变回原来的数字,暴力枚举所有数字,string大法好! */ /************************************************ Author :Running_Time Created Time :2015-8-3 8:43:02 File Name :A.cpp *************************************************/ #include <cstdio>…