結果

問題 No.2393 Bit Grid Connected Component
コンテスト
ユーザー とろちゃ
提出日時 2023-07-28 22:27:05
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 817 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 125 ms
コンパイル使用メモリ 85,088 KB
実行使用メモリ 82,104 KB
最終ジャッジ日時 2026-04-23 04:17:51
合計ジャッジ時間 1,865 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
# from collections import *
# from heapq import *
# from itertools import *
# from math import *
# from datetime import *
# from decimal import *  # PyPyだと遅い
# from string import ascii_lowercase,ascii_uppercase
# import numpy as np
import sys

# sys.setrecursionlimit(10**6) # PyPyだと遅い
INF = 10**20
MOD = 998244353
# MOD = 10**9 + 7
File = sys.stdin


def input():
    return File.readline()[:-1]


# ///////////////////////////////////////////////////////////////////////////


for _ in range(int(input())):
    x, y = map(int, input().split())
    idx_y = x // (2**y) // 2 + 1

    cnt = 0
    # print(idx_y, end=" ")
    while idx_y % 2 == 0:
        idx_y /= 2
        cnt += 1
    print(2 ** (y + 1 + cnt) - 1)
0