結果

問題 No.3254 Xor, Max and Sum
ユーザー moon17
提出日時 2025-09-05 22:44:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 191 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 82,528 KB
実行使用メモリ 54,264 KB
最終ジャッジ日時 2025-09-05 22:44:41
合計ジャッジ時間 4,142 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
if n%2==0:
  print(m*n)
else:
  ans=m*(n-1)
  f=x=0
  for i in range(30)[::-1]:
    if m>>i&1:
      f+=1
    else:
      if f>1:
        x|=1<<i
  print(ans+x*2)
0