結果

問題 No.2393 Bit Grid Connected Component
ユーザー Navier_Boltzmann
提出日時 2023-08-25 07:14:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2024-12-23 16:55:27
合計ジャッジ時間 3,696 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

def answer():
    
    x,y = map(int,input().split())
    for i in range(y,61):
        if (x>>i)&1:
            continue
        else:
            break
    if i==y:
        print(0)
        return
    print(pow(2,i)-1)
for _ in range(int(input())):
    answer()
0