結果

問題 No.2 素因数ゲーム
ユーザー momoyuumomoyuu
提出日時 2022-08-02 23:40:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 584 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 76,004 KB
最終ジャッジ日時 2023-10-01 00:11:49
合計ジャッジ時間 3,990 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,364 KB
testcase_01 AC 72 ms
71,496 KB
testcase_02 AC 72 ms
71,704 KB
testcase_03 AC 73 ms
71,136 KB
testcase_04 AC 73 ms
71,340 KB
testcase_05 AC 72 ms
71,280 KB
testcase_06 AC 75 ms
75,804 KB
testcase_07 AC 73 ms
75,924 KB
testcase_08 AC 72 ms
75,840 KB
testcase_09 AC 73 ms
75,988 KB
testcase_10 AC 75 ms
75,944 KB
testcase_11 AC 75 ms
76,004 KB
testcase_12 AC 75 ms
75,608 KB
testcase_13 AC 75 ms
75,956 KB
testcase_14 AC 73 ms
75,608 KB
testcase_15 AC 76 ms
75,928 KB
testcase_16 AC 76 ms
75,980 KB
testcase_17 AC 74 ms
75,868 KB
testcase_18 AC 74 ms
75,800 KB
testcase_19 AC 75 ms
75,936 KB
testcase_20 AC 75 ms
75,836 KB
testcase_21 AC 74 ms
75,640 KB
testcase_22 AC 73 ms
75,964 KB
testcase_23 AC 76 ms
75,976 KB
testcase_24 AC 76 ms
75,856 KB
testcase_25 AC 75 ms
75,796 KB
testcase_26 AC 74 ms
75,804 KB
testcase_27 AC 74 ms
75,784 KB
testcase_28 AC 74 ms
75,964 KB
testcase_29 AC 73 ms
75,608 KB
testcase_30 AC 74 ms
75,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
d = {}
import math
m = math.floor(math.sqrt(N))

for i in range(2,m+1):
    while N % i == 0:
        if not i in d:
            d[i] = 0
        d[i] += 1
        N //= i
if N != 1:
    if not N in d:
        d[N] = 0
    d[N] += 1

p = 0

def fin(p):
    if p == 0:
        print("Alice")
    else:
        print("Bob")
    exit()

if len(d) == 1:
    fin(0)


if len(d) == 2:
    l = []
    for i in d:
        l.append(i)
    if d[l[0]] == d[l[1]]:
        fin(1)
    else:
        fin(0)

a = 0
for i in d:
    a ^= d[i]
if a == 0:
    fin(1)
else:
    fin(0)


0