結果

問題 No.1452 XOR×OR
ユーザー 👑 rin204
提出日時 2022-03-23 20:38:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,052 KB
実行使用メモリ 59,440 KB
最終ジャッジ日時 2024-10-11 23:40:25
合計ジャッジ時間 3,122 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
lst = []
for i in range(1, int(n ** 0.5 + 1)):
    if n % i == 0:
        lst.append((i, n // i))

ans = 0
for a, b in lst:
    if a | b != b:
        continue
    
    cnt = 1
    for i in range(30):
        if b >> i & 1:
            if a >> i & 1:
                cnt *= 2
    ans += cnt // 2
print(ans)
0