上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 71 下一页
摘要: Problem Description Alice and Bob want to play an interesting game on a tree.Given is a tree on N vertices, The vertices are numbered from 1 to N. ver 阅读全文
posted @ 2018-02-10 08:09 Z-Y-Y-S 阅读(293) 评论(0) 推荐(0) 编辑
摘要: Description 给定正整数N,R。求 给定正整数N,R。求 Input 第一行一个数 T,表示有 T 组测试数据。 接下来 T 行,每行两个正整数 n,r。 第一行一个数 T,表示有 T 组测试数据。 接下来 T 行,每行两个正整数 n,r。 Output 输出 T 行,每行一个整数表示答案 阅读全文
posted @ 2018-02-09 15:55 Z-Y-Y-S 阅读(368) 评论(0) 推荐(0) 编辑
摘要: Description Claris和NanoApe在玩石子游戏,他们有n堆石子,规则如下: 1. Claris和NanoApe两个人轮流拿石子,Claris先拿。 2. 每次只能从一堆中取若干个,可将一堆全取走,但不可不取,拿到最后1颗石子的人获胜。 不同的初始局面,决定了最终的获胜者,有些局面下 阅读全文
posted @ 2018-02-08 20:04 Z-Y-Y-S 阅读(248) 评论(2) 推荐(0) 编辑
摘要: 传送门 题意: 有一棵n个点的无根树,节点依次编号为1到n,其中节点i的权值为vi, 定义一棵树的价值为它所有点的权值的异或和。 现在对于每个[0,m)的整数k,请统计有多少T的非空连通子树的价值等于k。 Sample Input 2 4 4 2 0 1 3 1 2 1 3 1 4 4 4 0 1 阅读全文
posted @ 2018-02-08 11:09 Z-Y-Y-S 阅读(324) 评论(0) 推荐(0) 编辑
摘要: Description 四年一度的幻想乡大选开始了,最近幻想乡最大的问题是很多来历不明的妖 怪涌入了幻想乡,扰乱了幻想乡昔日的秩序。但是幻想乡的建制派妖怪(人类) 博丽灵梦和八云紫等人整日高谈所有妖怪平等,幻想乡多元化等等,对于幻想乡 目前面临的种种大问题却给不出合适的解决方案。 风间幽香是幻想乡里 阅读全文
posted @ 2018-02-07 21:49 Z-Y-Y-S 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Description 你突然有了一个大房子,房子里面有一些房间。事实上,你的房子可以看做是一个包含n*m个格子的格状矩形,每个格子是一个房间或者是一个柱子。在一开始的时候,相邻的格子之间都有墙隔着。 你想要打通一些相邻房间的墙,使得所有房间能够互相到达。在此过程中,你不能把房子给打穿,或者打通柱子 阅读全文
posted @ 2018-02-07 17:55 Z-Y-Y-S 阅读(402) 评论(0) 推荐(0) 编辑
摘要: A permutation of length n is an array containing each integer from 1 to n exactly once. For example, q = [4, 5, 1, 2, 3] is a permutation. For the per 阅读全文
posted @ 2018-02-07 09:45 Z-Y-Y-S 阅读(274) 评论(0) 推荐(0) 编辑
摘要: Any case of shuffling of n cards can be described with a permutation of 1 to n. Thus there are totally n! cases of shuffling. Now suppose there are 5 阅读全文
posted @ 2018-02-06 20:41 Z-Y-Y-S 阅读(272) 评论(0) 推荐(0) 编辑
摘要: Beads of N colors are connected together into a circular necklace of N beads (N<=1000000000). Your job is to calculate how many different kinds of the 阅读全文
posted @ 2018-02-06 15:03 Z-Y-Y-S 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Description Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are prod 阅读全文
posted @ 2018-02-06 11:18 Z-Y-Y-S 阅读(236) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 71 下一页