結果

問題 No.2393 Bit Grid Connected Component
ユーザー hato336hato336
提出日時 2023-07-28 22:18:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 568 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 90,240 KB
最終ジャッジ日時 2024-04-16 06:16:21
合計ジャッジ時間 5,924 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 150 ms
85,632 KB
testcase_01 AC 148 ms
85,504 KB
testcase_02 AC 147 ms
85,632 KB
testcase_03 AC 142 ms
85,632 KB
testcase_04 AC 143 ms
85,760 KB
testcase_05 AC 144 ms
85,632 KB
testcase_06 AC 144 ms
85,504 KB
testcase_07 AC 150 ms
85,632 KB
testcase_08 AC 146 ms
85,632 KB
testcase_09 AC 143 ms
85,632 KB
testcase_10 AC 147 ms
85,632 KB
testcase_11 AC 145 ms
85,888 KB
testcase_12 AC 143 ms
85,760 KB
testcase_13 AC 160 ms
89,728 KB
testcase_14 AC 193 ms
89,984 KB
testcase_15 AC 192 ms
89,984 KB
testcase_16 AC 285 ms
90,240 KB
testcase_17 AC 545 ms
90,240 KB
testcase_18 AC 553 ms
90,112 KB
testcase_19 AC 568 ms
90,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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