摘要: Description There are n cities in Berland. Some pairs of them are connected with m directed roads. One can use only these roads to move from one city 阅读全文
posted @ 2017-09-29 20:36 NaVi_Awson 阅读(488) 评论(0) 推荐(0) 编辑
摘要: Description Polycarp is in really serious trouble — his house is on fire! It's time to save the most valuable items. Polycarp estimated that it would 阅读全文
posted @ 2017-09-29 14:51 NaVi_Awson 阅读(315) 评论(0) 推荐(0) 编辑
摘要: Description Ivan has an array consisting of n elements. Each of the elements is an integer from 1 to n. Recently Ivan learned about permutations and t 阅读全文
posted @ 2017-09-29 12:52 NaVi_Awson 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Description A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0, it reaches the poin 阅读全文
posted @ 2017-09-29 12:13 NaVi_Awson 阅读(493) 评论(0) 推荐(0) 编辑
摘要: Description 在这个问题中,给定一个值S和一棵树。在树的每个节点有一个正整数,问有多少条路径的节点总和达到S。路径中节点的深度必须是升序的。假设节点1是根节点,根的深度是0,它的儿子节点的深度为1。路径不必一定从根节点开始。 Input 第一行是两个整数N和S,其中N是树的节点数。 第二行 阅读全文
posted @ 2017-09-29 09:13 NaVi_Awson 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Description 在加里敦中学的小明最近爱上了数学竞赛,很多数学竞赛的题都是与序列的连续和相关的。所以对于一个序列,求出它们所有的连续和来说,小明觉得十分的简单。但今天小明遇到了一个序列和的难题,这个题目不仅要求你快速的求出所有的连续和,还要快速的求出这些连续和的异或值。小明很快的就求出了所有 阅读全文
posted @ 2017-09-29 00:13 NaVi_Awson 阅读(497) 评论(0) 推荐(0) 编辑