結果
問題 |
No.7 プライムナンバーゲーム
|
ユーザー |
|
提出日時 | 2021-06-22 21:00:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 622 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,948 KB |
最終ジャッジ日時 | 2024-06-23 17:05:17 |
合計ジャッジ時間 | 7,229 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 14 |
ソースコード
def sosu(N): nums = [n for n in range(2, N + 1)] i = 0 while i <= len(nums) - 1: j = i + 1 while j <= len(nums) - 1: if nums[j] % nums[i] == 0: nums.pop(j) else: j = j + 1 i += 1 return nums def check(N): sosus = sosu(N) wins = [0, 1] for i in range(4, N + 1): for s in sosus: if (i - s) not in wins: wins.append(i) break if N in wins: return 'Win' else: return 'Lose' if __name__ == '__main__': N = int(input()) print(check(N))