結果

問題 No.2393 Bit Grid Connected Component
ユーザー rlangevin
提出日時 2023-07-28 21:26:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 76,288 KB
最終ジャッジ日時 2024-10-06 17:33:07
合計ジャッジ時間 2,245 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

T = int(input())
for _ in range(T):
    x, y = map(int, input().split())
    if (x >> y) & 1 == 0:
        print(0)
        continue
    while True:
        if (x >> y) & 1:
            y += 1
        else:
            break
    print(2 ** y - 1)
0