結果

問題 No.1452 XOR×OR
ユーザー rlangevinrlangevin
提出日時 2023-02-02 22:37:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 75,748 KB
最終ジャッジ日時 2023-09-15 03:34:13
合計ジャッジ時間 5,492 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,248 KB
testcase_01 AC 75 ms
71,252 KB
testcase_02 AC 80 ms
75,508 KB
testcase_03 AC 78 ms
71,244 KB
testcase_04 AC 73 ms
71,132 KB
testcase_05 AC 75 ms
71,476 KB
testcase_06 AC 78 ms
75,184 KB
testcase_07 AC 78 ms
75,380 KB
testcase_08 AC 79 ms
75,328 KB
testcase_09 AC 79 ms
75,640 KB
testcase_10 AC 77 ms
75,468 KB
testcase_11 AC 77 ms
75,420 KB
testcase_12 AC 76 ms
75,588 KB
testcase_13 AC 76 ms
75,436 KB
testcase_14 AC 75 ms
75,476 KB
testcase_15 AC 76 ms
75,408 KB
testcase_16 AC 78 ms
75,360 KB
testcase_17 AC 78 ms
75,432 KB
testcase_18 AC 77 ms
75,436 KB
testcase_19 AC 76 ms
75,748 KB
testcase_20 AC 76 ms
75,488 KB
testcase_21 AC 77 ms
75,328 KB
testcase_22 AC 79 ms
75,212 KB
testcase_23 AC 78 ms
75,408 KB
testcase_24 AC 77 ms
75,204 KB
testcase_25 AC 76 ms
75,508 KB
testcase_26 AC 77 ms
75,408 KB
testcase_27 AC 77 ms
75,312 KB
testcase_28 AC 77 ms
75,264 KB
testcase_29 AC 78 ms
75,260 KB
testcase_30 AC 78 ms
75,388 KB
testcase_31 AC 76 ms
75,424 KB
testcase_32 AC 76 ms
75,456 KB
testcase_33 AC 75 ms
75,356 KB
testcase_34 AC 76 ms
75,416 KB
testcase_35 AC 74 ms
75,456 KB
testcase_36 AC 77 ms
75,500 KB
testcase_37 AC 76 ms
75,480 KB
testcase_38 AC 76 ms
75,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def div(n):
    if n <= 0:
        return []
    S = set()
    i = 1
    while i * i <= n:
        if n % i == 0:
            S.add(i)
            S.add(n // i)
        i += 1
    return list(S)

def f(X, Y):
    val = 1
    for i in range(35):
        x = (X >> i) & 1
        y = (Y >> i) & 1
        if x:
            if y:
                val *= 2
        else:
            if y:
                return 0
    if val % 2:
        return 1
    else:
        return val//2
                
            
N = int(input())
ans = 0
for d1 in div(N):
    d2 = N // d1
    ans += f(d1, d2)
print(ans)
0