摘要:
Given 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 m 阅读全文
摘要:
Anadi has a set of dominoes. Every domino has two parts, and each part contains some dots. For every aa and bb such that 1≤a≤b≤61≤a≤b≤6, there is exac 阅读全文
摘要:
The only difference between the easy and the hard versions is the maximum value of kk. You are given an infinite sequence of form "112123123412345……" 阅读全文
摘要:
Dawid has four bags of candies. The ii-th of them contains aiai candies. Also, Dawid has two friends. He wants to give each bag to one of his two frie 阅读全文
摘要:
Ania has a large integer SS. Its decimal representation has length nn and doesn't contain any leading zeroes. Ania is allowed to change at most kk dig 阅读全文
摘要:
在国际象棋里,王是最重要的一个棋子。每一步,王可以往上下左右或者对角线方向移动一步,如下图所示 给定两个格子 A(r1c1) B(r2c2),你的任务是计算出一个王从 A到 B至少需要走多少步。为了避免题目太简单,我们从棋盘里拿掉了一个格子 C(r3c3)(ABC保证互不相同),要求王从 A走到 B 阅读全文
摘要:
Given a sequence a[1]a[2]a[3]......a[n] your job is to calculate the max sum of a sub-sequence. For example given (6-154-7) the max sum in this sequen 阅读全文
摘要:
有个脑筋急转弯是这样的:有距离很近的一高一低两座桥,两次洪水之后高桥被淹了两次,低桥却只被淹了一次,为什么?答案是:因为低桥太低了,第一次洪水退去之后水位依然在低桥之上,所以不算“淹了两次”。举例说明: 假定高桥和低桥的高度分别是5和2,初始水位为1 第一次洪水:水位提高到6(两个桥都被淹),退到2 阅读全文
摘要:
There is a white sheet of paper lying on a rectangle table. The sheet is a rectangle with its sides parallel to the sides of the table. If you will ta 阅读全文
摘要:
Farmer 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 numb 阅读全文