C. Little Elephant and Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Little Elephant has got a problem — somebody has been touching his sorted by non-decreasing array a of le…
B. Little Elephant and Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Little Elephant loves numbers. He has a positive integer x. The Little Elephant wants to find the number…
E. Little Elephant and Shifts time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Little Elephant has two permutations a and b of length n, consisting of numbers from 1 to n, inclusive. Le…
D. Little Elephant and Array time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output The Little Elephant loves playing with arrays. He has array a, consisting of n positive integers, indexed from…
A. Little Elephant and Function time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Little Elephant enjoys recursive functions. This time he enjoys the sorting function. Let a is a permuta…
Educational Codeforces Round 40 F. Runner's Problem 题意: 给一个$ 3 * m \(的矩阵,问从\)(2,1)$ 出发 走到 \((2,m)\) 的方案数 \(mod 1e9 + 7\), 走的规则和限制如下: From the cell (i, j) you may advance to: (i - 1, j + 1) - only if i > 1, (i, j + 1), or (i + 1, j + 1) - only if i <…
二次联通门 : Codeforces 221d D. Little Elephant and Array /* Codeforces 221d D. Little Elephant and Array 题意 : 询问一段区间中出现次数等于自身的数的个数 正解是dp 莫队水过, 作为我莫队的入门题 myj的思路 66 把所有需查询的区间排序 当前查询区间的答案为上一个区间的答案通过多次的区间移动得出 */ #include <algorithm> #include <cstdio>…
ACM思维题训练集合 The Little Elephant has got a problem - somebody has been touching his sorted by non-decreasing array a of length n and possibly swapped some elements of the array. The Little Elephant doesn't want to call the police until he understands i…
221C 思路: 水题: 代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 200005 int n,ai[maxn],bi[maxn],ans; inline void in(int &now) { ;now=; char Cget=getchar(); ') { ;…
A - Noldbach problem 题面链接 http://codeforces.com/contest/17/problem/A 题面 Nick is interested in prime numbers. Once he read about Goldbach problem. It states that every even integer greater than 2 can be expressed as the sum of two primes. That got Nic…