結果

問題 No.1452 XOR×OR
ユーザー titia
提出日時 2025-04-09 06:41:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-04-09 06:41:18
合計ジャッジ時間 3,466 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:
            ANS+=count//2

print(ANS)
0