南理工ACM选拔赛07年的题目
//这是第一题,完整的是六道题目,在附件里,最多有人做出了3道,比赛时间是3小时,今年是5小时! An unual set is defined as that if a and b are in the set, a+b+a*b is in the set too. For example, if it's defined that 2 and 3 are in the set, 11 (2+3+2*3) is in the set and so on. Now, Allen has his problem with the unual set. He wants to know that if that if it's defined that 1 and 2 are in the set, how about some other integer? Your program is to read a series of input lines. Each input line will have a single integer on it, that will be from 1 to 2^30. For each integer read, if the integer is in the unual set give the answer "1". Else, please output "0". InputThe input consists of a series of single integer, one per line. The integer is in the range of 1 to 2^30. The input will be terminated by end-of-file. OutputThe output is a "0" if the input integer is not in the set, else print "1". There is one line of output for each input line. Sample Input5 17 18 Sample Output1 1 0
附件: 您所在的用户组无法下载或查看附件
搜索更多相关主题的帖子:
ACM 选拔赛 理工 set 题目