結果

問題 No.7 プライムナンバーゲーム
ユーザー syunsukesyunsuke
提出日時 2020-09-19 10:03:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 561 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 76,812 KB
最終ジャッジ日時 2023-09-05 11:26:19
合計ジャッジ時間 2,808 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,504 KB
testcase_01 AC 75 ms
71,472 KB
testcase_02 AC 90 ms
76,616 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 86 ms
76,392 KB
testcase_10 WA -
testcase_11 AC 85 ms
76,464 KB
testcase_12 WA -
testcase_13 AC 87 ms
76,416 KB
testcase_14 WA -
testcase_15 AC 86 ms
76,436 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
ans=[0 for i in range(N+1)]
P=[1 for i in range(N+1)]
for i in range(2,N+1):
    if P[i]==1:
        for j in range(2,N+1):
            if i*j<=N:
                P[i*j]=0
            else:
                break
#print(P)
for i in range(4,N+1):
    if P[i-2]+P[i-3]>0 or ans[i-2]+ans[i-3]==0:
        ans[i]=1
#print(ans)
if ans[N]==1:
    print("Win")
else:
    print("Lose")
            
0