結果
| 問題 | No.7 プライムナンバーゲーム |
| コンテスト | |
| ユーザー |
mkawa2
|
| 提出日時 | 2019-04-18 17:42:51 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 584 bytes |
| 記録 | |
| コンパイル時間 | 318 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,584 KB |
| 最終ジャッジ日時 | 2026-04-10 15:43:13 |
| 合計ジャッジ時間 | 3,254 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 10 |
ソースコード
n=int(input())
sosu=[2]
W=set()
L=set([2,3])
for i in range(3,n+1,2):
for s in sosu:
if i%s==0:
break
else:
sosu+=[i]
while 1:
for lk in L:
for s in sosu:
wk=lk+s
if wk==n and wk not in L:
print("Win")
exit()
elif wk<n:
W.add(wk)
W=W-L
for wk in W:
for s in sosu:
lk=wk+s
if lk==n and lk not in W:
print("Lose")
exit()
elif lk<n:
L.add(lk)
L=L-W
mkawa2