結果
| 問題 |
No.7 プライムナンバーゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-01-02 12:43:27 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 511 bytes |
| コンパイル時間 | 302 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 21,376 KB |
| 最終ジャッジ日時 | 2024-12-23 01:03:46 |
| 合計ジャッジ時間 | 73,541 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 2 TLE * 12 |
ソースコード
def findp(n):
p = []
for i in range(3,n):
check = True
for k in range(2,int(i**0.5)+2):
if i%k == 0:
check = False
if check:
p.append(i)
p.append(2)
return p
n = int(input())
p = findp(n)
identifier = 1
next = n - max(p)
while next != 3 and next != 2 and next != 1:
pp = findp(next)
next = next - max(p)
identifier = identifier*-1
if next == 1 and identifier == 1:
print('Lose')
elif next == 1 and identifier == -1:
print('Win')
elif identifier == 1:
print('Win')
else:
print('Lose')