結果

問題 No.1452 XOR×OR
ユーザー H3PO4
提出日時 2022-06-05 09:45:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-21 04:04:22
合計ジャッジ時間 3,011 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import isqrt


def calc(x, y):
    res = 1
    if x | y != y:
        return 0
    for i in range(32):
        xi = (x >> i) & 1
        yi = (y >> i) & 1
        if xi & yi:
            res *= 2
    return res


N = int(input())
ans = 0
for x in range(1, isqrt(N) + 1):
    if N % x:
        continue
    y = N // x
    ans += calc(x, y)
    ans += calc(y, x)
ans //= 2  # 順序区別しない
print(ans)
0