結果

問題 No.2393 Bit Grid Connected Component
ユーザー tnakao0123
提出日時 2023-08-07 10:34:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 40,704 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 14:27:03
合計ジャッジ時間 2,820 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 2393.cc:  No.2393 Bit Grid Connected Component - yukicoder
 */

#include<cstdio>
#include<algorithm>
 
using namespace std;

/* constant */

/* typedef */

typedef long long ll;

/* global variables */

/* subroutines */

/* main */

int main() {
  int tn;
  scanf("%d", &tn);

  while (tn--) {
    ll x;
    int y;
    scanf("%lld%d", &x, &y);

    while ((x >> (y + 1)) & 1) y++;
    printf("%lld\n", (1LL << (y + 1)) - 1);
  }
  return 0;
}
0