結果

問題 No.2393 Bit Grid Connected Component
ユーザー hiro1729hiro1729
提出日時 2023-07-21 16:44:43
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 3,903 ms
コンパイル使用メモリ 243,132 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 17:25:59
合計ジャッジ時間 4,953 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 11 ms
4,348 KB
testcase_15 AC 14 ms
4,348 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
T = int(input())
for _ in range(T):
	x, y = map(int, input().split())
	t = ((x + (1 << y)) >> y) << y
	for i in range(60):
		if t & (1 << i):
			print((1 << i) - 1)
			break
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
	int T, x, y;
	cin >> T;
	for (int _ = 0; _ < T; _++) {
		cin >> x >> y;
		int t = ((x + (1 << y)) >> y) << y;
		for (int i = 0; i < 60; i++) {
			if (t & (1 << i)) {
				cout << (1 << i) - 1 << '\n';
				break;
			}
		}
	}
}
0