結果

問題 No.1452 XOR×OR
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-03-31 14:55:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 689 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 86,764 KB
実行使用メモリ 75,900 KB
最終ジャッジ日時 2023-09-15 12:16:50
合計ジャッジ時間 4,968 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,928 KB
testcase_01 AC 70 ms
70,956 KB
testcase_02 AC 78 ms
75,360 KB
testcase_03 AC 71 ms
71,104 KB
testcase_04 AC 71 ms
71,116 KB
testcase_05 AC 72 ms
70,920 KB
testcase_06 AC 74 ms
75,520 KB
testcase_07 AC 77 ms
75,360 KB
testcase_08 AC 75 ms
75,224 KB
testcase_09 AC 80 ms
75,460 KB
testcase_10 AC 77 ms
75,140 KB
testcase_11 AC 76 ms
75,500 KB
testcase_12 AC 75 ms
75,008 KB
testcase_13 AC 77 ms
75,384 KB
testcase_14 AC 77 ms
75,136 KB
testcase_15 AC 75 ms
75,504 KB
testcase_16 AC 75 ms
75,528 KB
testcase_17 AC 76 ms
75,472 KB
testcase_18 AC 77 ms
75,496 KB
testcase_19 AC 77 ms
75,480 KB
testcase_20 AC 73 ms
75,144 KB
testcase_21 AC 74 ms
75,544 KB
testcase_22 AC 76 ms
75,364 KB
testcase_23 AC 75 ms
75,548 KB
testcase_24 AC 78 ms
75,824 KB
testcase_25 AC 77 ms
75,216 KB
testcase_26 AC 77 ms
75,364 KB
testcase_27 AC 75 ms
75,388 KB
testcase_28 AC 76 ms
75,364 KB
testcase_29 AC 74 ms
75,380 KB
testcase_30 AC 80 ms
75,140 KB
testcase_31 AC 78 ms
75,140 KB
testcase_32 AC 78 ms
75,824 KB
testcase_33 AC 76 ms
75,540 KB
testcase_34 AC 75 ms
75,900 KB
testcase_35 AC 77 ms
75,516 KB
testcase_36 AC 75 ms
75,512 KB
testcase_37 AC 74 ms
75,516 KB
testcase_38 AC 76 ms
75,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

Nの約数を列挙

A^B は、A|B に包含されている
A|B で立っていて、 A^B で立っていないのは、1通り
A|B で立っていて、 A^B で立っているのは、2通り
"""

import sys
from sys import stdin

def solve(a,b):

    #print (a,b)

    if a & b != b:
        return 0

    ret = 1
    for i in range(31):
        if 2**i & a > 0 and 2**i & b > 0:
            ret *= 2
    return ret

N = int(stdin.readline())

ans = 0

for i in range(1,N+1):

    if i ** 2 > N:
        break
    if i ** 2 == N:
        a = i
        b = i
        ans += solve(a,b)
    elif N % i == 0:
        a = i
        b = N // i
        ans += solve(b,a)

print (ans // 2)
0