搜索学习
文章平均质量分 80
「已注销」
我不管这个世上的人怎么说我,我只想依照我的信念做事,绝不后悔,不管现在将来都一样!
展开
-
Meteor Shower
Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a sa...原创 2018-08-16 08:24:17 · 936 阅读 · 0 评论 -
1268 和为K的组合
给出N个正整数组成的数组A,求能否从中选出若干个,使他们的和为K。如果可以,输出:"Yes",否则输出"No"。收起输入第1行:2个数N, K, N为数组的长度, K为需要判断的和(2 <= N <= 20,1 <= K <= 10^9)第2 - N + 1行:每行1个数,对应数组的元素A[i] (1 <= A[i] <= 10^6)输出...原创 2019-02-17 15:31:42 · 264 阅读 · 0 评论 -
G - 马走日
马在中国象棋以日字形规则移动。请编写一段程序,给定n*m大小的棋盘,以及马的初始位置(x,y),要求不能重复经过棋盘上的同一个点,计算马可以有多少途径遍历棋盘上的所有点。Input第一行为整数T(T < 10),表示测试数据组数。每一组测试数据包含一行,为四个整数,分别为棋盘的大小以及初始位置坐标n,m,x,y。(0<=x<=n-1,0<=y<=m-1,...原创 2018-11-30 13:10:27 · 163 阅读 · 0 评论 -
Prime Path
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices.— It is a matter of sec...原创 2018-09-23 08:10:44 · 129 阅读 · 0 评论 -
Rescue
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.Angel's friends want to ...原创 2018-09-23 08:06:43 · 124 阅读 · 0 评论 -
Catch That Cow
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,0...原创 2018-09-20 21:26:12 · 112 阅读 · 0 评论 -
Pots
You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; DROP(i) empty the po...原创 2018-09-20 21:23:43 · 289 阅读 · 0 评论 -
两点
福克斯在玩一款手机解迷游戏,这个游戏叫做”两点”。基础级别的时候是在一个n×m单元上玩的。像这样: 每一个单元有包含一个有色点。我们将用不同的大写字母来表示不同的颜色。这个游戏的关键是要找出一个包含同一颜色的环。看上图中4个蓝点,形成了一个环。一般的,我们将一个序列 d1,d2,...,dk 看成一个环,当且仅当它符合下列条件时:1. 这k个点不一样,即当 i≠j时, di...原创 2018-09-02 20:58:13 · 291 阅读 · 0 评论 -
Military Problem
In this problem you will have to help Berland army with organizing their command delivery system.There are nn officers in Berland army. The first officer is the commander of the army, and he does no...原创 2018-08-19 20:39:01 · 230 阅读 · 0 评论 -
1489 蜥蜴和地下室
哈利喜欢玩角色扮演的电脑游戏《蜥蜴和地下室》。此时,他正在扮演一个魔术师。在最后一关,他必须和一排的弓箭手战斗。他唯一能消灭他们的办法是一个火球咒语。如果哈利用他的火球咒语攻击第i个弓箭手(他们从左到右标记),这个弓箭手会失去a点生命值。同时,这个咒语使与第i个弓箭手左右相邻的弓箭手(如果存在)分别失去b(1 ≤ b < a ≤ 10)点生命值。因为两个端点的弓箭手(即标记为1和n的弓箭...原创 2019-02-20 12:52:33 · 114 阅读 · 0 评论