結果
| 問題 | 
                            No.2393 Bit Grid Connected Component
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-07-28 22:43:10 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 214 bytes | 
| コンパイル時間 | 222 ms | 
| コンパイル使用メモリ | 82,272 KB | 
| 実行使用メモリ | 77,156 KB | 
| 最終ジャッジ日時 | 2024-10-06 20:17:55 | 
| 合計ジャッジ時間 | 3,370 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 7 WA * 13 | 
ソースコード
T=int(input())
for _ in range(T):
  x,y=map(int,input().split())
  bit=bin(x)[2:][::-1]
  if y<len(bit) and bit[y]=="1":
    while y+1<len(bit):
      y+=1
    print((2**(y+1)-1))
  else:
    ans=0
    print(ans)