上一页 1 2 3 4 5 6 7 8 ··· 18 下一页
摘要: 题目描述 某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置设定初始弹力系数ki,当绵羊达到第i个装置时,它会往后弹ki步,达到第i+ki个装置,若不存在第i+ki个装置,则 阅读全文
posted @ 2018-08-13 14:57 Styx-ferryman 阅读(144) 评论(0) 推荐(0) 编辑
摘要: You are given n integers a1, a2, ..., an. A sequence of integers x1, x2, ..., xk is called a "xor-sequence" if for every 1 ≤ i ≤ k - 1 the number of o 阅读全文
posted @ 2018-08-13 14:07 Styx-ferryman 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 题目描述 辉辉热衷于洞穴勘测。 某天,他按照地图来到了一片被标记为JSZX的洞穴群地区。经过初步勘测,辉辉发现这片区域由n个洞穴(分别编号为1到n)以及若干通道组成,并且每条通道连接了恰好两个洞穴。假如两个洞穴可以通过一条或者多条通道按一定顺序连接起来,那么这两个洞穴就是连通的,按顺序连接在一起的这 阅读全文
posted @ 2018-08-12 21:05 Styx-ferryman 阅读(197) 评论(0) 推荐(0) 编辑
摘要: You are given a tree (a connected acyclic undirected graph) of n vertices. Vertices are numbered from 1 to n and each vertex is assigned a character f 阅读全文
posted @ 2018-08-07 11:26 Styx-ferryman 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给一棵树,每条边有权。求一条简单路径,权值和等于 KK ,且边的数量最小。 输入输出格式 输入格式: 第一行:两个整数 n,kn,k 。 第二至 nn 行:每行三个整数,表示一条无向边的两端和权值 (注意点的编号从 00 开始)。 输出格式: 一个整数,表示最小边数量。 如果不存在这样的路 阅读全文
posted @ 2018-08-06 20:46 Styx-ferryman 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 题目描述 聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。 他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游戏:由爸爸在纸上画 阅读全文
posted @ 2018-08-06 20:36 Styx-ferryman 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给你一棵TREE,以及这棵树上边的距离.问有多少对点它们两者间的距离小于等于K 输入输出格式 输入格式: N(n<=40000) 接下来n-1行边描述管道,按照题目中写的输入 接下来是k 输出格式: 一行,有多少对点之间的距离小于等于k 输入输出样例 输入样例#1: 7 1 6 13 6 阅读全文
posted @ 2018-08-06 20:28 Styx-ferryman 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Iahub wants to meet his girlfriend Iahubina. They both live in Ox axis (the horizontal axis). Iahub lives at point 0 and Iahubina at point d. Iahub ha 阅读全文
posted @ 2018-07-30 09:09 Styx-ferryman 阅读(427) 评论(0) 推荐(0) 编辑
摘要: There are less than 60 years left till the 900-th birthday anniversary of a famous Italian mathematician Leonardo Fibonacci. Of course, such important 阅读全文
posted @ 2018-07-28 18:27 Styx-ferryman 阅读(432) 评论(0) 推荐(1) 编辑
摘要: 题目描述 Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 阅读全文
posted @ 2018-07-26 20:24 Styx-ferryman 阅读(308) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 18 下一页