答案应该是正确的,怎么提交都不对呢?[python3]

P1008 [NOIP1998 普及组] 三连击

我知道错误在哪里了,不可以出现数字 0
by WNLJOKER @ 2019-04-25 15:27:17


代码更正如下,手动去除最后一行的空格就可以AC ```python def judge( num1, num2, num3 ): # the num can't be too large if num2 > 999 or num3 > 999: return False list_taken = [] list_1 = list(str(num1)) #check if numbers are repeated for x in list_1: if x in list_taken or x=='0': # repeated, False return False else: list_taken.append(x) # new numbers, occupie these numbers list_2 = list(str(num2)) for x in list_2: if x in list_taken or x=='0': return False else: list_taken.append(x) list_3 = list(str(num3)) for x in list_3: if x in list_taken or x=='0': return False else: list_taken.append(x) return True ans = [] num1 = 0 num2 = 0 num3 = 0 for i in range(100,334): num1 = i num2 = 2*i num3 = 3*i if judge(num1, num2, num3)==True: ans.append([num1, num2, num3]) for group in ans: for number in group: print(number, end = ' ') # each line ends by a space print() ```
by WNLJOKER @ 2019-04-25 15:31:33


@[WNLJOKER](/space/show?uid=179501) 你这是什么语言啊?
by Strong_Jelly @ 2019-04-25 15:32:30


@[神兵qqq1112](/space/show?uid=143681) 审题,`py3`
by Kirisame_Marisa_ @ 2019-04-25 15:35:59



by Strong_Jelly @ 2019-04-25 15:38:09


@[Kirisame_Marisa_](/space/show?uid=44534) 捕捉ZYT
by ferrum_cccp @ 2019-04-25 15:59:10


@[神兵qqq1112](/space/show?uid=143681) python3
by WNLJOKER @ 2019-04-25 16:13:16


你确定你提交的是“提交代码” 而不是“提交答案文本” 或“上传 zip 文件”吗
by 陈弘毅 @ 2019-04-25 16:28:12


@[陈弘毅](/space/show?uid=73561) 已经找到问题所在,提交的答案多了包含801的结果。因为不能包含数字0,所以WA了
by WNLJOKER @ 2019-04-25 16:44:03


@[wycero](/space/show?uid=72665) qaq
by Kirisame_Marisa_ @ 2019-04-25 17:33:29


| 下一页