結果

問題 No.7 プライムナンバーゲーム
コンテスト
ユーザー tnoda_
提出日時 2015-07-29 18:42:14
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 391 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 144 ms
コンパイル使用メモリ 77,448 KB
最終ジャッジ日時 2025-12-03 15:56:52
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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