結果
問題 |
No.3254 Xor, Max and Sum
|
ユーザー |
![]() |
提出日時 | 2025-09-06 02:48:21 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 270 bytes |
コンパイル時間 | 355 ms |
コンパイル使用メモリ | 82,840 KB |
実行使用メモリ | 54,368 KB |
最終ジャッジ日時 | 2025-09-06 02:48:26 |
合計ジャッジ時間 | 4,502 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 46 WA * 2 |
ソースコード
N,M=map(int,input().split()) if N%2 == 0: print(N*M) exit() if N==1: print(0) exit() ans=0 free = 0 for i in range(M.bit_length()-1,-1,-1): d = 2**i if d&M: ans+=(N//2)*2*d free+=1 else: ans+=(free//2)*2*d print(ans)