結果

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

ソースコード

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:
        x|=1<<i
  print(ans+x*2)
0