传送门:D - Game With Array 题意:让你构造一个长度为n的序列,并且n个数的和为S,问能不能找到一个1~n的数k,使得数组里找不出一个子序列的和为k或者n-k: 题解:最简单的想法肯定是让k=1,然后数组只要不出现1和n-1就好了,只要 s /n >= 2,也就是由n-1个2和一个 s-(n-1)*2 != 1 构成就可以. 1 #include<bits/stdc++.h> 2 #define ll long long 3 using namespace std; 4…
[codeforces 360]A. Levko and Array Recovery 试题描述 Levko loves array a1, a2, ... , an, consisting of integers, very much. That is why Levko is playing with array a, performing all sorts of operations with it. Each operation Levko performs is of one of…
A. Co-prime Array 题目连接: http://www.codeforces.com/contest/660/problem/A Description You are given an array of n elements, you must make it a co-prime array in as few moves as possible. In each move you can insert any positive integral number you want…
Little Elephant and Array Time Limit: 4000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 221D64-bit integer IO format: %I64d Java class name: (Any) The Little Elephant loves playing with arrays. He has array a,…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Recently Maxim has found an array of n integers, needed by no one. He immediately come up with idea of changing it: he invented positive integer…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output One spring day on his way to university Lesha found an array A. Lesha likes to split arrays into several parts. This time Lesha decided to split…
Educational Codeforces Round 63 (Rated for Div. 2) D. Beautiful Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an array aa consisting of nn integers. Beauty of array i…
题目链接: C. Artem and Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Artem has an array of n positive integers. Artem decided to play with it. The game consists of n moves. Each move g…