C. Good Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Let's call an array good if there is an element in the array that equals to the sum of all other elements. For example, the arr…
Codeforces Round #521 (Div. 3)  E. Thematic Contests 题目传送门 题意: 现在有n个题目,每种题目有自己的类型要举办一次考试,考试的原则是每天只有一种题目类型一种题目类型只能出现在一天每天的题目类型不能相同,而且后一天的题目数量必须正好为前一天的两倍,第一天的题目数量是任意的求怎么安排能使题目尽量多.注意:不是天数尽量多 思路: 首先我们知道一件事,题目属于哪种类型并不重要,重要的是每种类型的个数所以我们先统计出所有类型的个数,存进一个数组,而…
B. Sort the Array 题目连接: http://codeforces.com/contest/451/problem/B Description Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of n distinct integers. Unfortunately, the size of a is to…
任意门:http://codeforces.com/contest/1077/problem/D D. Cutting Out time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You are given an array ss consisting of nn integers. You have to find any ar…
http://codeforces.com/contest/1077/problem/D You are given an array ss consisting of nn integers. You have to find any array tt of length kk such that you can cut out maximum number of copies of array tt from array ss. Cutting out the copy of tt mean…
http://codeforces.com/contest/1077/problem/B There is a house with nn flats situated on the main street of Berlatov. Vova is watching this house every night. The house can be represented as an array of nn integer numbers a1,a2,…,ana1,a2,…,an, where a…
一 题面 E. Minimum Array 二 分析 注意前提条件:$0 \le  a_{i} \lt n$ 并且 $0 \le  b_{i} \lt n$.那么,我们可以在$a_{i}$中任取一个数进行分析,发现为满足字典序最小,在$b$中找到$n-a_{i}$就是最优解. 接下来分析$b$,在$b$中是不一定找得到$n-a_{i}$的.所以需要分析如何找到此情况下的最优解. 假设$a_{i} = 3$,$n = 4$,那么$b_{i}$对应的最优情况是$b_{i} = 1$,可以把所有$b_…
http://codeforces.com/contest/1077/problem/E output standard output Polycarp has prepared nn competitive programming problems. The topic of the ii-th problem is aiai, and some problems' topics may coincide. Polycarp has to host several thematic conte…
F1. Pictures with Kittens (easy version) 题目链接:https://codeforces.com/contest/1077/problem/F1 题意: 给出n个数,以及k,x,k即长度为k的区间至少选一个,x的意思是一共要选x个,少一个或者多一个都不行. 选一个会得到一定的奖励,问在满足条件的前提下,最多得到多少的奖励. 题解: 简单版本数据量比较小,考虑比较暴力的动态规划. dp[i,j]表示前i个数,要选第i个数,目前选了j个所得到的最大奖励,那么当…
http://codeforces.com/contest/1077/problem/A A frog is currently at the point 00 on a coordinate axis OxOx. It jumps by the following algorithm: the first jump is aa units to the right, the second jump is bb units to the left, the third jump is aa un…