
搜索专题
BZUzbx
这个作者很懒,什么都没留下…
展开
-
K - Find The Multiple
K - Find The MultipleGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not grea...原创 2019-11-24 21:08:58 · 155 阅读 · 0 评论 -
J - A Knight's Journey
J - A Knight’s JourneyBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround the world. Whenever a knight moves, it...原创 2019-11-24 21:07:55 · 171 阅读 · 0 评论 -
H - 哈密顿绕行世界问题
H - 哈密顿绕行世界问题一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1...原创 2019-11-24 21:06:40 · 143 阅读 · 0 评论 -
G - 迷宫问题
G - 迷宫问题定义一个二维数组:int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,表...原创 2019-11-24 21:04:47 · 1402 阅读 · 0 评论 -
F - Catch That Cow
F - Catch That CowFarmer 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 poi...原创 2019-11-24 21:03:39 · 223 阅读 · 0 评论 -
E - Curling 2.0
E - Curling 2.0On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a squ...原创 2019-11-24 21:02:01 · 165 阅读 · 0 评论 -
D - 棋盘问题
D - 棋盘问题在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k &...原创 2019-11-24 20:59:05 · 170 阅读 · 0 评论 -
C - 马走日
C - 马走日马在中国象棋以日字形规则移动。请编写一段程序,给定n*m大小的棋盘,以及马的初始位置(x,y),要求不能重复经过棋盘上的同一个点,计算马可以有多少途径遍历棋盘上的所有点。Input第一行为整数T(T < 10),表示测试数据组数。每一组测试数据包含一行,为四个整数,分别为棋盘的大小以及初始位置坐标n,m,x,y。(0<=x<=n-1,0<=y<...原创 2019-11-24 20:57:55 · 524 阅读 · 1 评论 -
B - 踩方格
B - 踩方格有一个方格矩阵,矩阵边界在无穷远处。我们做如下假设:a. 每走一步时,只能从当前方格移动一格,走到某个相邻的方格上;b. 走过的格子立即塌陷无法再走第二次;c. 只能向北、东、西三个方向走;请问:如果允许在方格矩阵上走n步,共有多少种不同的方案。2种走法只要有一步不一样,即被认为是不同的方案。Input允许在方格上行走的步数n(n <= 20)...原创 2019-11-24 20:56:56 · 182 阅读 · 0 评论 -
A - Oil Deposits
A - Oil DepositsThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a gri...原创 2019-11-24 20:54:26 · 223 阅读 · 0 评论