Codeforces Round #381(div 2)】的更多相关文章

B. Alyona and a tree 题目连接: http://codeforces.com/contest/739/problem/B Description Alyona has a tree with n vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positive integer, in the vertex i she wrote ai. Moreover, the g…
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…
题目链接: http://codeforces.com/contest/740/problem/D D. Alyona and a tree time limit per test2 secondsmemory limit per test256 megabytes 问题描述 Alyona has a tree with n vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positiv…
D. Alyona and a tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Alyona has a tree with n vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positive intege…
题目链接 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值肯定是区间最小的…
A.(分类讨论) 题意:你有n本书,有三种买书方案,花a元买1本,花b元买2本,花c元买3本,问最少花多少钱,使得你书的总数是4的倍数 分析:分类讨论的题,但是要注意你可以买超过4本书--可以买5本.6本.7本让你达到4的倍数 B.=w= C.(构造) 题意:设mex[i][j]表示一段区间i,j内最小的没出现过的非负整数,你有m个询问[x,y],构造一个数组a,使得m个询问对应的区间中mex最小的最大. 分析:易得让最短的区间的值填0..ans-1,构造的话就是先把最短区间从x到y依次填上0.…
A. Alyona and copybooks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have equal…
D. Alyona and a tree Problem Description: Alyona has a tree with n vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positive integer, in the vertex i she wrote ai. Moreover, the girl wrote a positive integer to every edg…
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…
B. Alyona and flowers Problem Description: Let's define a subarray as a segment of consecutive flowers. The mother suggested some set of subarrays. Alyona wants to choose several of the subarrays suggested by her mother. After that, each of the flowe…