結果

問題 No.1452 XOR×OR
ユーザー convexineqconvexineq
提出日時 2021-04-01 10:49:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 86,756 KB
実行使用メモリ 75,448 KB
最終ジャッジ日時 2023-09-15 12:21:04
合計ジャッジ時間 4,959 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,972 KB
testcase_01 AC 71 ms
71,308 KB
testcase_02 AC 76 ms
74,892 KB
testcase_03 AC 71 ms
71,212 KB
testcase_04 AC 73 ms
70,884 KB
testcase_05 AC 72 ms
71,148 KB
testcase_06 AC 78 ms
74,980 KB
testcase_07 AC 79 ms
74,988 KB
testcase_08 AC 75 ms
74,992 KB
testcase_09 AC 76 ms
75,276 KB
testcase_10 AC 81 ms
75,392 KB
testcase_11 AC 76 ms
74,920 KB
testcase_12 AC 75 ms
74,996 KB
testcase_13 AC 76 ms
74,672 KB
testcase_14 AC 76 ms
74,924 KB
testcase_15 AC 76 ms
74,672 KB
testcase_16 AC 76 ms
75,188 KB
testcase_17 AC 76 ms
74,976 KB
testcase_18 AC 76 ms
74,792 KB
testcase_19 AC 78 ms
74,864 KB
testcase_20 AC 77 ms
75,288 KB
testcase_21 AC 76 ms
75,188 KB
testcase_22 AC 76 ms
74,672 KB
testcase_23 AC 77 ms
75,352 KB
testcase_24 AC 76 ms
74,996 KB
testcase_25 AC 77 ms
75,324 KB
testcase_26 AC 76 ms
74,672 KB
testcase_27 AC 78 ms
75,196 KB
testcase_28 AC 76 ms
74,980 KB
testcase_29 AC 77 ms
75,448 KB
testcase_30 AC 75 ms
75,304 KB
testcase_31 AC 80 ms
74,920 KB
testcase_32 AC 77 ms
75,208 KB
testcase_33 AC 78 ms
75,292 KB
testcase_34 AC 78 ms
75,232 KB
testcase_35 AC 77 ms
74,676 KB
testcase_36 AC 77 ms
74,952 KB
testcase_37 AC 77 ms
74,788 KB
testcase_38 AC 77 ms
74,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisor_list(N): #約数のリスト
    if N == 1: return [1]
    res = []
    for i in range(1,N):
        if i*i >= N: break
        if N%i == 0:
            res.append(i)
            res.append(N//i)
    if i*i == N: res.append(i)
    return sorted(res)

def f(a,b): #x^y = a, x|y = b?
    ans = 1
    while a or b:
        p,q = a%2, b%2
        if p==q==1: ans *= 2
        if p==1 and q==0: ans = 0
        a //= 2
        b //= 2
    return (1+ans)//2

n = int(input())
print(sum(f(i,n//i) for i in divisor_list(n)))
0