結果

問題 No.2393 Bit Grid Connected Component
コンテスト
ユーザー hato336
提出日時 2023-07-28 22:18:10
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 304 ms / 2,000 ms
+ 486µs
コード長 430 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 76 ms
コンパイル使用メモリ 80,896 KB
実行使用メモリ 88,448 KB
最終ジャッジ日時 2026-09-11 06:06:28
合計ジャッジ時間 4,019 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
t = int(input())


for i in range(t):
    x,y = map(int,input().split())
    for j in range(60):
        if j < y and ((x >> j) & 1) == 0:
            x += 2**j

    temp = 0
    for j in range(60):
        if ((x >> j) & 1) == 1:
            temp += 2**j
        else:
            break
    print(temp)
0