結果

問題 No.7 プライムナンバーゲーム
ユーザー tnoda_
提出日時 2015-07-29 18:42:14
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-17 22:08:21
合計ジャッジ時間 2,282 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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