結果

問題 No.1452 XOR×OR
ユーザー nasubi24nasubi24
提出日時 2021-03-31 14:57:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 57,984 KB
最終ジャッジ日時 2024-07-02 15:40:06
合計ジャッジ時間 2,988 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n=int(input())
ans=0
for i in range(1,int(math.sqrt(n))+1):
    if n%i==0:
        m=n//i
        n1=bin(i)[2:]
        m1=bin(m)[2:]
        n1="0"*(len(m1)-len(n1))+n1
        cnt=1
        yn=True
        for j in range(len(m1)):
            if n1[j]==m1[j] and n1[j]=="1":
                cnt*=2
            elif n1[j]=="1" and m1[j]=="0":
                yn=False
                break
        if yn:
            ans+=cnt//2
print(ans)
0