读书人

usaco dualpal 11难倒不是10进制的回

发布时间: 2012-03-26 15:46:56 作者: rapoo

usaco dualpal 11难倒不是10进制的回文数?

题目要求输入 n ,s
输出大于s的n个数(满足用2到10间进制表示时为回文数)下面是测试的结果,第二个测试没过。但是11难道不是
回文数吗?请高手解答.


Test 1: TEST OK [0.000 secs, 1916 KB]

> Run 2: Execution error: Your program did not produce an answer
that was judged as correct. The program stopped at 0.011 seconds;
it used 1916 KB of memory.

Here are the respective outputs:
----- our output ---------
15
16
17
18
20
21
24
26
27
---- your output ---------
11
12
13
14
15
16
17
18
20
--------------------------

------ Data for Run 2 ------
9 10
----------------------------



[解决办法]
注意题目要求:
finds and prints (in base 10) the first N numbers strictly greater than S that are palindromic when written in two or more number bases (2 <= base <= 10).

即至少用2种基数表示是回文数的才符合要求.
11只有一种基数(10)表示是回文数,因此不符合题目要求.

读书人网 >C语言

热点推荐