結果
| 問題 |
No.3254 Xor, Max and Sum
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2025-09-06 02:49:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 256 bytes |
| コンパイル時間 | 373 ms |
| コンパイル使用メモリ | 82,240 KB |
| 実行使用メモリ | 53,952 KB |
| 最終ジャッジ日時 | 2025-09-06 02:49:43 |
| 合計ジャッジ時間 | 4,478 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / 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(30,-1,-1):
d = 2**i
if d&M:
ans+=(N//2)*2*d
free+=1
else:
ans+=(free//2)*2*d
print(ans)
nikoro256