結果
問題 | No.2 素因数ゲーム |
ユーザー |
![]() |
提出日時 | 2022-07-17 12:03:11 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 5,000 ms |
コード長 | 676 bytes |
コンパイル時間 | 171 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 57,856 KB |
最終ジャッジ日時 | 2024-06-29 13:13:43 |
合計ジャッジ時間 | 2,472 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
import sys, math sys.setrecursionlimit(1000000) INF = 1 << 100 #mod = 1000000007 mod = 998244353 input = lambda: sys.stdin.readline().rstrip() li = lambda: list(map(int, input().split())) def factorization(x): lst = [] if x == 1: return lst for n in range(2, x + 1): if n * n > x or x == 1: break count = 0 while x % n == 0: x //= n count += 1 if count: lst.append((n, count)) if x > 1: lst.append((x, 1)) return lst N = int(input()) fact = factorization(N) x = 0 for _, i in fact: x ^= i if x: ans = 'Alice' else: ans = 'Bob' print(ans)