結果

問題 No.7 プライムナンバーゲーム
ユーザー tnoda_tnoda_
提出日時 2015-07-29 18:42:14
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 6,652 KB
実行使用メモリ 6,508 KB
最終ジャッジ日時 2023-09-24 21:44:29
合計ジャッジ時間 2,616 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
6,328 KB
testcase_01 AC 94 ms
6,320 KB
testcase_02 AC 95 ms
6,332 KB
testcase_03 AC 94 ms
6,448 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 94 ms
6,300 KB
testcase_08 WA -
testcase_09 AC 95 ms
6,384 KB
testcase_10 AC 94 ms
6,304 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 95 ms
6,444 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_prime(x):
    for i in range(2, x):
        if x % i == 0:
            return False
    return True

primes = [x for x in range(2, 1000) if is_prime(x)]
memo = [False] * 10010
for i in range(2, 10010):
    if memo[i]:
        continue
    for p in primes:
        if i + p > 10000:
            break
        memo[i+p] = True
if memo[input()]:
    print('Win')
else:
    print('Lose')
0