結果
| 問題 | No.2393 Bit Grid Connected Component |
| コンテスト | |
| ユーザー |
とろちゃ
|
| 提出日時 | 2023-07-28 23:03:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 158 ms / 2,000 ms |
| コード長 | 801 bytes |
| 記録 | |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 85,580 KB |
| 実行使用メモリ | 81,536 KB |
| 最終ジャッジ日時 | 2026-04-23 06:59:41 |
| 合計ジャッジ時間 | 2,792 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 20 |
ソースコード
# 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())
cnt = 0
for i in range(70):
if x & 1 << y + i + 1:
cnt += 1
else:
break
print(2 ** (y + cnt + 1) - 1)
とろちゃ