結果
問題 |
No.2 素因数ゲーム
|
ユーザー |
![]() |
提出日時 | 2015-10-05 00:25:43 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 725 bytes |
コンパイル時間 | 119 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-07-19 19:36:31 |
合計ジャッジ時間 | 2,592 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 12 |
ソースコード
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def solve(n, num): count = [] for i in num: if n < i: break cnt = 0 while n % i == 0: n = n // i #d.append(i) #d_set.add(i) cnt += 1 count.append(cnt) x = 0 for j in range(len(count)): x ^= count[j] if x == 0: return False else: return True M = 10000 table = [True] * (M + 1) num = [] for i in range(2, M + 1): if not table[i]: continue k = i + i while k < M + 1: table[k] = False k += i num.append(i) n = int(input()) if solve(n, num): print("Alice") else: print("Bob")