結果

問題 No.2393 Bit Grid Connected Component
ユーザー hiryuNhiryuN
提出日時 2023-07-28 21:57:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 461 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 2,270 ms
コンパイル使用メモリ 81,504 KB
実行使用メモリ 77,576 KB
最終ジャッジ日時 2024-04-16 05:52:16
合計ジャッジ時間 3,621 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,992 KB
testcase_01 AC 39 ms
52,072 KB
testcase_02 AC 40 ms
52,484 KB
testcase_03 AC 39 ms
52,984 KB
testcase_04 AC 41 ms
53,132 KB
testcase_05 AC 40 ms
52,268 KB
testcase_06 AC 39 ms
52,832 KB
testcase_07 AC 41 ms
53,220 KB
testcase_08 AC 39 ms
53,020 KB
testcase_09 AC 40 ms
52,588 KB
testcase_10 AC 39 ms
52,400 KB
testcase_11 AC 39 ms
52,532 KB
testcase_12 AC 39 ms
53,156 KB
testcase_13 AC 40 ms
53,500 KB
testcase_14 AC 104 ms
77,004 KB
testcase_15 AC 117 ms
77,576 KB
testcase_16 AC 189 ms
76,524 KB
testcase_17 AC 460 ms
76,476 KB
testcase_18 AC 448 ms
76,716 KB
testcase_19 AC 461 ms
77,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t=int(input())

def f(a,b):
    a=str(bin(a))
    key=-b-1
    while a[key]=="1":
        key-=1
    key+=1
    key*=-1
    print(2**key-1)
for i in range(t):
    a,b=map(int,input().split())
    f(a,b)
    
0