結果

問題 No.7 プライムナンバーゲーム
ユーザー netyo715netyo715
提出日時 2021-06-21 11:34:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 9,812 KB
最終ジャッジ日時 2023-09-05 01:51:23
合計ジャッジ時間 7,386 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,900 KB
testcase_01 AC 19 ms
8,908 KB
testcase_02 AC 884 ms
9,724 KB
testcase_03 WA -
testcase_04 AC 32 ms
8,848 KB
testcase_05 WA -
testcase_06 AC 269 ms
9,460 KB
testcase_07 AC 187 ms
9,212 KB
testcase_08 AC 94 ms
9,024 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 195 ms
9,104 KB
testcase_12 AC 650 ms
9,664 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 776 ms
9,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

hurui = set(range(2, N+1))
for i in range(2, N+1):
    for j in range(i*2, N+1, i):
        hurui.discard(j)

f = [False]*100000
f[0] = True
f[1] = True
for i in range(2, N):
    flag = False
    for j in hurui:
        if not f[i-j]:
            flag = True
            break
    f[i] = flag

if f[N-1]:
    print("Win")
else:
    print("Lose")
0