結果

問題 No.1452 XOR×OR
ユーザー NaHCO314
提出日時 2021-03-16 22:05:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 58,624 KB
最終ジャッジ日時 2024-07-02 15:37:45
合計ジャッジ時間 2,998 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = 1
ans = 0

while x*x <= n:
    if n % x != 0:
        x += 1
        continue
    o = n // x
    cnt = 1
    for i in range(60):
        x_bit = (x >> i) & 1
        o_vit = (o >> i) & 1
        if x_bit == 1 and o_vit == 1:
            cnt *= 2
        if x_bit == 1 and o_vit == 0:
            cnt = 0
    ans += cnt
    x += 1

print(ans // 2)
0