結果

問題 No.1452 XOR×OR
ユーザー titia
提出日時 2025-04-09 06:32:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 547 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-04-09 06:32:05
合計ジャッジ時間 3,653 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())

LIST=[]

for i in range(1,round(N**(1/2))+1):
    if N%i==0:
        LIST.append(i)

LIST.sort()

ANS=0

for x in LIST:
    y=N//x

    if x<=y:
        flag=1
        count=1

        for i in range(60):
            if (x & (1<<i) != 0) and (y & (1<<i) == 0):
                flag=0
            if (y & (1<<i) != 0) and (x & (1<<i) != 0):
                count*=2

        if flag:
            if count%2==0:
                ANS+=count//2
            else:
                ANS+=count

print(ANS)
0