题意 : 题目的要求是构造出一个长度为 n 的数列, 构造条件是在接下来给出的 m 个子区间中, 要求每一个子区间的mex值最大, 然后在这 m 个子区间产生的mex值中取最小的输出, 并且输出构造出来的序列, 一个mex值的定义是这个区间没有出现过的最小的正整数, 例如(0, 2, 3)的mex = 1    (0, 1, 2)的mex=3 分析 : 发现在这m个mex值中, 最小的肯定是区间长度最小的, 而且这个mex值肯定是等于这个区间的长度, 记这个mex为Min(mex)所以输出的就是…
C. Alyona and mex Problem Description: Alyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. Alyona is a capricious girl so after she gets the array, she inspects m of its subarrays. Subarray is…
题意 : 将从 1 ~ n 的数分成两组,要求两组和的差值尽可能小,并输出其中一组的具体选数情况 分析 : 如果将这 n 个数从大到小四个一组来进行选择的话那么差值就为 0 ,然后再来考虑 n%4 != 0 的情况.举个例子就是 n = 9 的时候,我们考虑 6 7 8 9 ,将6.9放入一组,7.8放入第二组,那么此时差值就会为 0 ,接下来再对 2 3 4 5 进行同样的取法此时差值仍为 0 ,最后剩下一个 1 ,很显然最后的最小差值应当为 1 .其实综合考虑一下 n%4 != 0 的情况只…
A. Alyona and mex 题目连接: http://codeforces.com/contest/739/problem/A Description Alyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. Alyona is a capricious girl so after she gets the array, she…
Problem description Alyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. Alyona is a capricious girl so after she gets the array, she inspects m of its subarrays. Subarray is a set of some subse…
Alyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. Alyona is a capricious girl so after she gets the array, she inspects m of its subarrays. Subarray is a set of some subsequent elements of th…
题目链接 http://codeforces.com/contest/740/problem/C 题意:有一串数字,给你m个区间求每一个区间内不含有的最小的数,输出全部中最小的那个尽量使得这个最小值最大,然后把符合条件的数字串输出,输出任意一种即可 这题只要理解题意差不多就能做出来了,很简单 由于题目要求的mex要最大(mex指着个区间中的数在0-n中缺少的最小的数字例如mex(1,2)=0,mex(0,2)=1,mex(0,1)=2) 所以尽量要从零开始递增,那么最小的mex值肯定是区间最小的…
C. Alyona and mex time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Alyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. Alyona is…
B. Alyona and Mex time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Someone gave Alyona an array containing n positive integers a1, a2, ..., an. In one operation, Alyona can choose any elemen…
Alyona and Mex 题目链接: http://acm.hust.edu.cn/vjudge/contest/121333#problem/B Description Someone gave Alyona an array containing n positive integers a1, a2, ..., an. In one operation, Alyona can choose any element of the array and decrease it, i.e. re…