結果

問題 No.2393 Bit Grid Connected Component
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-08-25 07:14:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 196 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 65,652 KB
実行使用メモリ 66,708 KB
最終ジャッジ日時 2023-08-25 10:13:50
合計ジャッジ時間 5,449 ms
ジャッジサーバーID
(参考情報)
judge000 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
58,824 KB
testcase_01 AC 88 ms
59,060 KB
testcase_02 AC 92 ms
59,052 KB
testcase_03 AC 90 ms
58,992 KB
testcase_04 AC 95 ms
58,728 KB
testcase_05 AC 92 ms
58,964 KB
testcase_06 AC 91 ms
59,048 KB
testcase_07 AC 90 ms
58,776 KB
testcase_08 AC 92 ms
59,036 KB
testcase_09 AC 92 ms
58,656 KB
testcase_10 AC 90 ms
58,680 KB
testcase_11 AC 103 ms
58,792 KB
testcase_12 AC 103 ms
58,824 KB
testcase_13 AC 110 ms
58,884 KB
testcase_14 AC 137 ms
65,772 KB
testcase_15 AC 143 ms
65,916 KB
testcase_16 AC 152 ms
65,392 KB
testcase_17 AC 196 ms
66,708 KB
testcase_18 AC 191 ms
66,512 KB
testcase_19 AC 190 ms
66,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

def answer():
    
    x,y = map(int,input().split())
    for i in range(y,61):
        if (x>>i)&1:
            continue
        else:
            break
    if i==y:
        print(0)
        return
    print(pow(2,i)-1)
for _ in range(int(input())):
    answer()
0