摘要: Input第一行两个整数N和M,为矩阵的边长。 第二行一个整数D,为豆子的总个数。 第三行包含D个整数V1到VD,分别为每颗豆子的分值。 接着N行有一个N×M的字符矩阵来描述游戏矩阵状态,0表示空格,#表示障碍物。而数字1到9分别表示对应编号的豆子。 Output仅包含一个整数,为最高可能获得的分值 阅读全文
posted @ 2020-04-16 07:38 ghosh 阅读(120) 评论(0) 推荐(0) 编辑
摘要: An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it imme 阅读全文
posted @ 2020-04-14 22:18 ghosh 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 给出一个N个点的树,找出一个点来,以这个点为根的树时,所有点的深度之和最大 Input 给出一个数字N,代表有N个点.N<=1000000 下面N-1条边. Output 输出你所找到的点,如果具有多个解,请输出编号最小的那个. Sample Input8 1 4 5 6 4 5 6 7 6 8 2 阅读全文
posted @ 2020-04-13 16:04 ghosh 阅读(195) 评论(0) 推荐(0) 编辑
摘要: B君在围观一群男生和一群女生玩游戏,具体来说游戏是这样的:给出一棵n个节点的树,这棵树的每条边有一个权值,这个权值只可能是0或1。 在一局游戏开始时,会确定一个节点作为根。接下来从女生开始,双方轮流进行 操作。当一方操作时,他们需要先选择一个不为根的点,满足该点到其父亲的边权为1; 然后找出这个点到 阅读全文
posted @ 2020-04-13 16:00 ghosh 阅读(165) 评论(0) 推荐(0) 编辑
摘要: On another floor of the A.R.C. Markland-N, the young man Simon "Xenon" Jackson, takes a break after finishing his project early (as always). Having a 阅读全文
posted @ 2020-04-11 17:41 ghosh 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 题意:一辆车,分成两侧,中间有一条直接到车尾的通道,通道两边分别有r排,s列座位,人们要从座位上移动到通道,再到车尾,每次移动1个单位用1的时间,问所有人都离开车的时间。如果一个人从座位移动到通道,如果相邻的通道的位置上有人,座位上的人无法通过,必须等到这个位置没人时才能过。 分析:这个题如果从正面 阅读全文
posted @ 2020-04-11 17:13 ghosh 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Chris家的电话铃响起了,里面传出了Chris的老师焦急的声音:“喂,是Chris的家长吗?你们的孩子又没来上课,不想参加考试了吗?”一听说要考试,Chris的父母就心急如焚,他们决定在尽量短的时间内找到Chris。他们告诉Chris的老师:“根据以往的经验,Chris现在必然躲在朋友S 阅读全文
posted @ 2020-04-09 17:46 ghosh 阅读(132) 评论(0) 推荐(0) 编辑
摘要: UVA - 11300 Spreading the Wealth Description A Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyonea 阅读全文
posted @ 2020-04-09 16:34 ghosh 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目链接 Farmer John has arranged his N (1 ≤ N ≤ 5,000) cows in a row and many of them are facing forward, like good cows. Some of them are facing backwar 阅读全文
posted @ 2020-04-07 14:36 ghosh 阅读(107) 评论(0) 推荐(0) 编辑
摘要: NEKO#ΦωΦ has just got a new maze game on her PC! The game's main puzzle is a maze, in the forms of a 2×n2×n rectangle grid. NEKO's task is to lead a N 阅读全文
posted @ 2020-04-05 16:58 ghosh 阅读(157) 评论(0) 推荐(0) 编辑
莫挨老子!