結果
| 問題 |
No.7 プライムナンバーゲーム
|
| コンテスト | |
| ユーザー |
mkawa2
|
| 提出日時 | 2019-04-18 21:56:59 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 584 ms / 5,000 ms |
| コード長 | 398 bytes |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-01 16:19:53 |
| 合計ジャッジ時間 | 4,551 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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