結果

問題 No.2 素因数ゲーム
ユーザー otsunekootsuneko
提出日時 2021-04-24 13:19:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 76,676 KB
最終ジャッジ日時 2023-09-17 13:35:13
合計ジャッジ時間 4,750 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,860 KB
testcase_01 AC 97 ms
71,612 KB
testcase_02 AC 96 ms
71,592 KB
testcase_03 AC 98 ms
71,376 KB
testcase_04 AC 97 ms
71,528 KB
testcase_05 AC 96 ms
71,792 KB
testcase_06 AC 95 ms
71,544 KB
testcase_07 AC 96 ms
71,616 KB
testcase_08 AC 100 ms
76,676 KB
testcase_09 AC 97 ms
71,612 KB
testcase_10 AC 97 ms
71,668 KB
testcase_11 AC 95 ms
71,500 KB
testcase_12 AC 96 ms
71,752 KB
testcase_13 AC 95 ms
71,500 KB
testcase_14 AC 96 ms
71,600 KB
testcase_15 AC 102 ms
76,664 KB
testcase_16 AC 100 ms
76,468 KB
testcase_17 AC 97 ms
71,500 KB
testcase_18 AC 95 ms
71,508 KB
testcase_19 AC 105 ms
76,664 KB
testcase_20 AC 104 ms
76,512 KB
testcase_21 AC 103 ms
76,612 KB
testcase_22 AC 103 ms
76,552 KB
testcase_23 AC 97 ms
71,628 KB
testcase_24 AC 103 ms
76,332 KB
testcase_25 AC 102 ms
76,476 KB
testcase_26 AC 97 ms
71,508 KB
testcase_27 AC 96 ms
71,656 KB
testcase_28 AC 97 ms
71,612 KB
testcase_29 AC 97 ms
71,504 KB
testcase_30 AC 102 ms
76,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

N = int(input())
prime = prime_decomposition(N)
d = Counter()
d.update(prime)

xor = 0
for key in d:
    xor = xor ^ d[key]

if xor:
    print("Alice")
else:
    print("Bob")
0