Codeforces Round #359 (Div. 1)】的更多相关文章

C. Robbers' watch time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Robbers, who attacked the Gerda's cab, are very successful in covering from the kingdom police. To make the goal of catchi…
题目链接:http://codeforces.com/problemset/problem/686/C 给你n和m,问你有多少对(a, b) 满足0<=a <n 且 0 <=b < m 且a的7进制和n-1的7进制位数相同 且b的7进制和m-1的7进制位数相同,还有a和b的7进制上的每位上的数各不相同. 看懂题目,就很简单了,先判断a和b的7进制位数是否超过7,不超过的话就dfs暴力枚举计算就可以了. //#pragma comment(linker, "/STACK:1…
A http://codeforces.com/contest/685/standings 题意:给你n和m,找出(a,b)的对数,其中a满足要求:0<=a<n,a的7进制的位数和n-1的7进制的位数相同,b满足要求:0<=b<m,b的7进制的位数和m-1的7进制的位数相同,且a和b的7进制下的位上的数都不相同 思路:如果a b的位数和大于7显然会有重复,缩小范围以后,可以根据题意暴力枚举 // #pragma comment(linker, "/STACK:102400…
B. Kay and Snowflake 题目连接: http://www.codeforces.com/contest/685/problem/B Description After the piece of a devilish mirror hit the Kay's eye, he is no longer interested in the beauty of the roses. Now he likes to watch snowflakes. Once upon a time,…
A. Robbers' watch 题目连接: http://www.codeforces.com/contest/685/problem/A Description Robbers, who attacked the Gerda's cab, are very successful in covering from the kingdom police. To make the goal of catching them even harder, they use their own watc…
B. Little Robber Girl's Zoo 题目连接: http://www.codeforces.com/contest/686/problem/B Description Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, th…
A. Free Ice Cream 题目连接: http://www.codeforces.com/contest/686/problem/A Description After their adventure with the magic mirror Kay and Gerda have returned home and sometimes give free ice cream to kids in the summer. At the start of the day they hav…
题目链接:http://codeforces.com/contest/686/problem/C题目大意:给你两个十进制的数n和m,选一个范围在[0,n)的整数a,选一个范围在[0,m)的整数b,要求a的7进制表示和b的7进制表示中的每一位都不重复.其中,a的7进制位数和n-1的7进制位数相同,b的位数和m-1的位数相同.比如,当n=2,m=3时,a和b的其进制表示的所有集合是:a=0, b=1 a=0, b=2 a=1, b=0a=1, b=2 解法:这套题目可以用dfs做.我们开一个数组f[…
A:= v = B:^ w ^ C:一天n个小时,一个小时m分(n,m十进制),一个手表有两部分,左边表示时,右边表示分,但都是7进制,而且手表上最多只能有7个数字且数字不能重复,现在要你算出能正确表示出多少个时间(不够位需要补0).因为进制只有7,所以可以枚举所有的7进制数,然后再切成7组,分为左边和右边,判断是否符合n,m条件,计数即可.O(7*7^7) D:给你一个n个节点的树,有q个询问(n,q<=300000),每次询问一个x,问以x为顶点的子树中,删除哪一个点后使得这个子树剩下的联通…
D. Kay and Snowflake     After the piece of a devilish mirror hit the Kay's eye, he is no longer interested in the beauty of the roses. Now he likes to watch snowflakes. Once upon a time, he found a huge snowflake that has a form of the tree (connect…