結果

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

ソースコード

diff #

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

ans=0
for i in range(len(d)):
  ct=1
  x=format(d[i],'032b')
  x2=format(n//d[i],'032b')
  for j in range(32):
    if x[j]=='1' and x2[j]=='1':
      ct*=2
    elif x[j]=='1' and x2[j]=='0':
      ct*=0
  ans+=ct
print(ans//2)
0