上一页 1 ··· 81 82 83 84 85 86 87 88 89 ··· 97 下一页
摘要: 【题目描述】 在一个 4×4 的棋盘上有 8 个黑棋和 8 个白棋,当且仅当两个格子有公共边,这两个格子上的棋是相邻的。移动棋子的规则是交换相邻两个棋子。 给出一个初始棋盘和一个最终棋盘,请找出一个最短的移动序列使初始棋盘变为最终棋盘。 【输入】 ... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(214) 评论(0) 推荐(0)
摘要: 【题目描述】 给定一个 n×n 的网格状地图,每个方格 (i,j)有一个高度 wij​​ 。如果两个方格有公共顶点,则它们是相邻的。 定义山峰和山谷如下: 均由地图上的一个连通块组成; 所有方格高度都相同; 周围的方格(即不属于山峰或山谷但与山峰... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(217) 评论(0) 推荐(0)
摘要: 【题目描述】 在一个 4×4 的方框内摆放了若干个相同的玩具,某人想将这些玩具重新摆放成为他心中理想的状态,规定移动时只能将玩具向上下左右四个方向移动,并且移动的位置不能有玩具,请你用最少的移动次数将初始的玩具状态移动到目标状态。 【输入】 前四行表... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(103) 评论(0) 推荐(0)
摘要: 【题目描述】 给定一个 r 行 c 列的在电视上的“虚拟键盘”,通过「上,下,左,右,选择」共 555 个控制键,你可以移动电视屏幕上的光标来打印文本。一开始,光标在键盘的左上角,每次按方向键,光标总是跳到下一个在该方向上与当前位置不同的字符,若不存在则... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(235) 评论(0) 推荐(0)
摘要: Problem Description Now, Bob is playing an interesting game in which he is a general of a harmonious army. There are n soldiers... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(46) 评论(0) 推荐(0)
摘要: Problem Description Y_UME has just found a number x in his right pocket. The number is a non-negative integer ranging from 0 to... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(19) 评论(0) 推荐(0)
摘要: Problem Description Tom has a string containing only lowercase letters. He wants to choose a subsequence of the string whose le... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(23) 评论(0) 推荐(0)
摘要: Problem Description As the current heir of a wizarding family with a long history,unfortunately, you find yourself forced to pa... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(21) 评论(0) 推荐(0)
摘要: 【题目描述】 编写一个程序,计算一个骑士从棋盘上的一个格子到另一个格子所需的最小步数。骑士一步可以移动到的位置由下图给出。 【输入】 第一行给出骑士的数量 n。 在接下来的 3n 行中,每 3 行描述了一个骑士。其中,第一行一个整数 L 表示棋... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(125) 评论(0) 推荐(0)
摘要: Problem Description This is an era of team success, but also an era of heroes. Throughout the ages, there have been numerous ex... 阅读全文
posted @ 2022-09-20 22:51 老程序员111 阅读(21) 评论(0) 推荐(0)
上一页 1 ··· 81 82 83 84 85 86 87 88 89 ··· 97 下一页