Total Submit: 1508 Accepted Submit: 561
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, the name "anna" is a palindrome. Numbers can also be palindromes (e.g. 151 or 753357). Additionally numbers can of course be ordered in size. The first few palindrome
numbers are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, ...
The number 10 is not a palindrome (even though you could write it as 010) but a zero as leading digit is not allowed.
Input
The input consists of a series of lines with each line containing one integer value i (1<= i <= 2*10^9 ). This integer value i indicates the index of the palindrome number that is to be written to the output, where index 1 stands for the first palindrome number (1), index 2 stands for the second palindrome number (2) and so on. The input is terminated by a line containing 0.
Output
For each line of input (except the last one) exactly one line of output containing a single (decimal) integer value is to be produced. For each input value i the i-th palindrome number is to be written to the output.
Sample Input
1
12
24
0
Sample Output
1
33
151
/*简单翻译一下,把回文数字从小到大排列.输入n输出对应第n个回文数字 */
Total Submit: 740 Accepted Submit: 352
A lattice point (x, y) in the first quadrant (x and y are integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x, y) does not pass through any other lattice point. For example, the point (4, 2) is not visible since the line from the origin passes through (2, 1). The figure below shows the points (x, y) with 0 <= x, y <= 5 with lines from the origin to the visible points.
Write a program which, given a value for the size, N, computes the number of visible points (x,y) with 0 <= x, y <= N.
Input
The first line of input contains a single integer C, (1 <= C <= 1000) which is the number of datasets that follow.
Each dataset consists of a single line of input containing a single integer N, (1 <= N <= 1000), which is the size.
Output
For each dataset, there is to be one line of output consisting of: the dataset number starting at 1, a single space, the size, a single space and the number of visible points for that size.
Sample Input
4
2
4
5
231
Sample Output
1 2 5
2 4 13
3 5 21
4 231 32549
/*输入一个数字n代表一个方格的宽度.方格的左下角是原点,方格中点的坐标都是整数.如果方格中有某个点与原点的连线不经过另外的点则称做这一点是可以从原点看见的.
输入 n
输出 可以看见点的个数.
最近发现论坛上有很多人在ZJU上做题目所以发了这两个题目.
大家可以把自己代码到下面地址去提交测试.
http://acm.zju.edu.cn/show_problem.php?pid=2000
http://acm.zju.edu.cn/show_problem.php?pid=2777
鼓励写的好的发上来让大家学习.没有通过的也可以发上来让大家一起来找出错误.
另外如果有愿意发每期题目的人请和我说一下