09 2018 档案
摘要:Description 农民约翰有三个容量分别是A,B,C升的桶,A,B,C分别是三个从1到20的整数,最初,A和B桶都是空的,而C桶是装满牛奶的。有时,约翰把牛奶从一个桶倒到另一个桶中,直到被灌桶装满或原桶空了。当然每一次灌注都是完全的。由于节约,牛奶不会有丢失。 写一个程序去帮助约翰找出当A桶是
阅读全文
摘要:Description A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed ed
阅读全文
摘要:1.3.3 Calf Flac Description 据说如果你给无限只母牛和无限台巨型便携式电脑(有非常大的键盘),那么母牛们会制造出世上最棒的回文。你的工作就是去寻找这些牛制造的奇观(最棒的回文)。 在寻找回文时不用理睬那些标点符号、空格(但应该保留下来以便做为答案输出),只用考虑字母'A'-
阅读全文
摘要:1.2.4 Palindromic Squares 回文平方数 Description 回文数是指从左向右念和从右向左念都一样的数。如12321就是一个典型的回文数。 给定一个进制B(2<=B<=20,由十进制表示),输出所有的大于等于1小于等于300(十进制下)且它的平方用B进制表示时是回文数的数
阅读全文
摘要:1.2.3 Name That Number 命名那个数字 Description 在威斯康辛州牛大农场经营者之中,都习惯于请会计部门用连续数字给母牛打上烙印。但是,母牛用手机时并没感到这个系统的便利,它们更喜欢用它们喜欢的名字来呼叫它们的同伴,而不是用像这个的语句"C'mon, #4734, ge
阅读全文
摘要:1.2.1 Milking Cows 挤牛奶 Description 三个农民每天清晨5点起床,然后去牛棚给3头牛挤奶。第一个农民在300时刻(从5点开始计时,秒为单位)给他的牛挤奶,一直到1000时刻。第二个农民在700时刻开始,在 1200时刻结束。第三个农民在1500时刻开始2100时刻结束。
阅读全文
摘要:Description 你有一条由N个红色的,白色的,或蓝色的珠子组成的项链(3<=N<=350),珠子是随意安排的。 这里是 n=29 的二个 例子: 第一和第二个珠子在图片中已经被作记号。 图片 A 中的项链可以用下面的字符串表示: brbrrrbbbrrrrrbrrbbrbbbbrrrrb .
阅读全文
摘要:Since Sonya is interested in robotics too, she decided to construct robots that will read and recognize numbers. Sonya has drawn nn numbers in a row,
阅读全文
摘要:Slava plays his favorite game "Peace Lightning". Now he is flying a bomber on a very specific map. Formally, map is a checkered field of size 1 × n, t
阅读全文
摘要:Sonya decided to organize an exhibition of flowers. Since the girl likes only roses and lilies, she decided that only these two kinds of flowers shoul
阅读全文
摘要:Allen wants to enter a fan zone that occupies a round square and has nn entrances. There already is a queue of aiai people in front of the ii-th entra
阅读全文
摘要:You are given two strings ss and tt, both consisting only of lowercase Latin letters. The substring s[l..r]s[l..r] is the string which is obtained by
阅读全文
摘要:Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positiv
阅读全文
摘要:Description 考虑在下面被显示的数字金字塔。 写一个程序来计算从最高点开始在底部任意处结束的路径经过数字的和的最大。 每一步可以走到左下方的点也可以到达右下方的点。 在上面的样例中,从7 到 3 到 8 到 7 到 5 的路径产生了最大和:30 Input 第一个行包含 R(1<= R<=
阅读全文
摘要:Description 排序是一种很频繁的计算任务。现在考虑最多只有三值的排序问题。一个实际的例子是,当我们给某项竞赛的优胜者按金银铜牌序的时候。 在这个任务中可能的值只有三种1,2和3。我们用交换的方法把他排成升序的。 写一个程序计算出,给定的一个1,2,3组成的数字序列,排成升序所需的最少交换次
阅读全文
摘要:Description 一块N x N(1<=N<=10)正方形的黑白瓦片的图案要被转换成新的正方形图案。写一个程序来找出将原始图案按照以下列转换方法转换成新图案的最小方式: 1:转90度:图案按顺时针转90度。 2:转180度:图案按顺时针转180度。 3:转270度:图案按顺时针转270度。 4
阅读全文
摘要:Description The most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (this
阅读全文

浙公网安备 33010602011771号