算法题:小猫爬山

问题描述 Freda和rainbow饲养了N只小猫,这天,小猫们要去爬山。经历了千辛万苦,小猫们终于爬上了山顶,但是疲倦的它们再也不想徒步走下山了(呜咕>_<)。 Freda和rainbow只好花钱让它们坐索道下山。索道上的缆车最大承重量为W,而N只小猫的重量分别是C1,C2,…,CN。当然,每辆缆

ConstStar ConstStar 发布于 2023-05-28

算法题:武士风度的牛

问题描述 农民John有很多牛,他想交易其中一头被Don称为The Knight的牛。这头牛有一个独一无二的超能力,在农场里像Knight一样地跳(就是我们熟悉的象棋中马的走法)。虽然这头神奇的牛不能跳到树上和石头上,但是它可以在牧场上随意跳,我们把牧场用一个x,y 的坐标图来表示。 描述 这头神奇

ConstStar ConstStar 发布于 2023-05-28

算法题:乳草的入侵

问题描述 Farmer John一直努力让他的草地充满鲜美多汁的而又健康的牧草。可惜天不从人愿,他在植物大战人类中败下阵来。邪恶的乳草已经在他的农场的西北部份佔领了一片立足之地。 草地像往常一样,被分割成一个高度為Y(1≤y≤100), 宽度为X(1≤x≤100)的直角网格。(1,1)是左下角的格(

ConstStar ConstStar 发布于 2023-05-25

算法题:Team Queue

问题描述 Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though

ConstStar ConstStar 发布于 2023-05-25

算法题:Raising Modulo Numbers

问题描述 People are different. Some secretly read magazines full of interesting girls' pictures, others create an A-bomb in their cellar, others like usin

ConstStar ConstStar 发布于 2023-05-23

算法题:Sunscreen

问题描述 To avoid unsightly burns while tanning, each of the C (1≤C≤2500) cows must cover her hide with sunscreen when they're at the beach. Cow i has a m

ConstStar ConstStar 发布于 2023-05-22

算法题:最大子序和

问题描述 输入一个长度为n的整数序列,从中找出一段不超过m的连续子序列,使得整个序列的和最大。 例如 1,-3,5,1,-2,3 当m=4时,S=5+1−2+3=7 当m=2或m=3时,S=5+1=6 输入格式 第一行两个数n,m(n,m≤300000) 第二行有n个数,要求在n个数找到最大子序和

ConstStar ConstStar 发布于 2023-05-22

算法题:兔子与兔子

问题描述 很久很久以前,森林里住着一群兔子。有一天,兔子们想要研究自己的 DNA 序列。我们首先选取一个好长好长的 DNA 序列(小兔子是外星生物,DNA 序列可能包含 26 个小写英文字母),然后我们每次选择两个区间,询问如果用两个区间里的 DNA 序列分别生产出来两只兔子,这两个兔子是否一模一样

ConstStar ConstStar 发布于 2023-05-15

算法题:Extended Braille

问题描述 The Blind Association for Pretty Calligraphy is annoyed by the lack of emoticons and math symbols in the braille alphabet. Given that the braille

ConstStar ConstStar 发布于 2023-05-15

算法题:Bubble-bubble Sort

问题描述 Bubbles! As a fanatical supporter of the Bubbles Are Perfect Creatures movement, you have accumulated a large collection of bubbles in all colour

ConstStar ConstStar 发布于 2023-05-15