結果

問題 No.2393 Bit Grid Connected Component
コンテスト
ユーザー ntuda
提出日時 2023-07-30 15:12:41
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 249 ms / 2,000 ms
コード長 240 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 126 ms
コンパイル使用メモリ 85,632 KB
実行使用メモリ 81,920 KB
最終ジャッジ日時 2026-04-25 13:21:42
合計ジャッジ時間 3,119 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

T = int(input())
for _ in range(T):
    x, y = map(int, input().split())
    B = []
    while x > 0:
        B.append(x % 2)
        x //= 2
    NB = len(B)
    ans = 0
    while y < NB and B[y] == 1:
        y += 1
    print((1 << y) - 1)
0