結果
問題 | No.2 素因数ゲーム |
ユーザー |
![]() |
提出日時 | 2019-12-27 10:37:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 903 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-07 15:16:20 |
合計ジャッジ時間 | 2,277 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def PrimeFactorization(x0): x = x0 res = [] e = 0 while x & 1 == 0: e += 1 x >>= 1 if e: res.append([2, e]) for b in range(3, x0, 2): if b ** 2 > x0: break e = 0 while x % b == 0: e += 1 x //= b if e: res.append([b, e]) if x == 1: break if x > 1: res.append([x, 1]) return res def main(): n = int(input()) pf = PrimeFactorization(n) g = 0 for b, e in pf: g ^= e if g: print("Alice") else: print("Bob") main()