結果
| 問題 |
No.2393 Bit Grid Connected Component
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-28 22:47:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 570 ms / 2,000 ms |
| コード長 | 217 bytes |
| コンパイル時間 | 1,410 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 77,312 KB |
| 最終ジャッジ日時 | 2024-10-06 20:24:49 |
| 合計ジャッジ時間 | 4,705 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 20 |
ソースコード
T=int(input())
for _ in range(T):
x,y=map(int,input().split())
#(x,y)は黒マス
bit=bin(x)[2:][::-1]
if y<len(bit) and bit[y]=="1":
while y+1<len(bit) and bit[y+1]=="1":
y+=1
print((2**(y+1)-1))