摘要:
【题目描述】 在一个 4×4 的方框内摆放了若干个相同的玩具,某人想将这些玩具重新摆放成为他心中理想的状态,规定移动时只能将玩具向上下左右四个方向移动,并且移动的位置不能有玩具,请你用最少的移动次数将初始的玩具状态移动到目标状态。 【输入】 前四行表... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(99)
评论(0)
推荐(0)
摘要:
【题目描述】 给定一个 r 行 c 列的在电视上的“虚拟键盘”,通过「上,下,左,右,选择」共 555 个控制键,你可以移动电视屏幕上的光标来打印文本。一开始,光标在键盘的左上角,每次按方向键,光标总是跳到下一个在该方向上与当前位置不同的字符,若不存在则... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(231)
评论(0)
推荐(0)
摘要:
【题目描述】 编写一个程序,计算一个骑士从棋盘上的一个格子到另一个格子所需的最小步数。骑士一步可以移动到的位置由下图给出。 【输入】 第一行给出骑士的数量 n。 在接下来的 3n 行中,每 3 行描述了一个骑士。其中,第一行一个整数 L 表示棋... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(115)
评论(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
阅读(16)
评论(0)
推荐(0)
摘要:
Problem Description There are nn points in an array with index from 1 to n, and there are two operations to those points. 1: 1... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(10)
评论(0)
推荐(0)
摘要:
Problem Description Carneginon was a chic bard. But when he was young, he was frivolous and had joined many gangs. Recently, Ca... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(6)
评论(0)
推荐(0)
摘要:
Problem Description The hot summer came so quickly that Xiaoming and Xiaohong decided to buy a big and sweet watermelon. But th... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(9)
评论(0)
推荐(0)
摘要:
Problem Description After Asgard was destroyed, tanker brought his soldiers to earth, and at the same time took on the importan... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(21)
评论(0)
推荐(0)
摘要:
【线性同余方程组】 由若干个线性同余方程构成的线性方程组。 例如: 其解法最早由我国《孙子算经》给出,因此解法称为“孙子定理”,又叫“中国剩余定理”,实质即为求多个数的最小公倍数。 【中国剩余定理】 1.内容 设自然数 两两互质,并记 ,则同余方程组: 在... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(209)
评论(0)
推荐(0)
摘要:
Problem Description 定义一个函数 μ(x):如果 x 等于 k 个不同的质数的乘积,则 μ(x)=(−1)^k,否则(即 x 有大于 1 的平方因子) μ(x)=0 定义 lcm(a,b) 为 a,b 的最小公倍数,给定 n,... 阅读全文
posted @ 2022-09-20 22:51
老程序员111
阅读(44)
评论(0)
推荐(0)

浙公网安备 33010602011771号