結果

問題 No.2 素因数ゲーム
ユーザー qibqib
提出日時 2023-02-05 12:28:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 304 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 75,652 KB
最終ジャッジ日時 2023-09-17 05:19:46
合計ジャッジ時間 4,132 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,136 KB
testcase_01 AC 75 ms
71,364 KB
testcase_02 AC 75 ms
71,292 KB
testcase_03 AC 73 ms
71,036 KB
testcase_04 AC 74 ms
71,304 KB
testcase_05 AC 71 ms
70,860 KB
testcase_06 AC 76 ms
75,552 KB
testcase_07 AC 75 ms
75,556 KB
testcase_08 AC 74 ms
75,652 KB
testcase_09 AC 76 ms
75,580 KB
testcase_10 AC 77 ms
75,580 KB
testcase_11 AC 77 ms
75,076 KB
testcase_12 AC 76 ms
75,380 KB
testcase_13 AC 76 ms
75,076 KB
testcase_14 AC 73 ms
75,556 KB
testcase_15 AC 77 ms
75,408 KB
testcase_16 AC 75 ms
75,624 KB
testcase_17 AC 75 ms
75,580 KB
testcase_18 AC 75 ms
75,436 KB
testcase_19 AC 76 ms
75,364 KB
testcase_20 AC 76 ms
75,500 KB
testcase_21 AC 76 ms
75,372 KB
testcase_22 AC 76 ms
75,604 KB
testcase_23 AC 76 ms
75,588 KB
testcase_24 AC 78 ms
75,568 KB
testcase_25 AC 76 ms
75,396 KB
testcase_26 AC 75 ms
75,648 KB
testcase_27 AC 77 ms
75,364 KB
testcase_28 AC 77 ms
75,548 KB
testcase_29 AC 73 ms
75,440 KB
testcase_30 AC 76 ms
75,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())

cnt = {}
cur = n
for x in range(2, int(math.sqrt(n)) + 1):
  if cur % x == 0:
    cnt[x] = 0
    while cur % x == 0:
      cnt[x] += 1
      cur //= x

if cur > 1:
  cnt[cur] = 1

ans = 0
for v in cnt.values():
  ans ^= v

if ans == 0:
  print("Bob")
else:
  print("Alice")
0