結果
| 問題 |
No.7 プライムナンバーゲーム
|
| コンテスト | |
| ユーザー |
mkawa2
|
| 提出日時 | 2020-01-02 22:52:19 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 627 ms / 5,000 ms |
| コード長 | 398 bytes |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-01 16:29:57 |
| 合計ジャッジ時間 | 5,051 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
n=int(input())
sosu=[2]
dp=[0]*(n+1)
dp[2]=-1
dp[3]=-1
for i in range(3,n+1,2):
for s in sosu:
if i%s==0:
break
else:
sosu+=[i]
for i in range(4,n+1):
for s in sosu:
if s>i-2:
dp[i]=-1
break
if dp[i-s]==-1:
dp[i]=1
break
else:
dp[i]=-1
print("Win") if dp[-1]==1 else print("Lose")
mkawa2