結果

問題 No.2393 Bit Grid Connected Component
ユーザー vjudge1
提出日時 2025-08-15 14:19:14
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 1,555 ms
コンパイル使用メモリ 158,136 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-08-15 14:19:18
合計ジャッジ時間 3,654 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long

using namespace std;

int t, y;
ll x;

inline void Solve(){
  cin >> x >> y;
  for(; y <= 60; y++){
    if(!(x & (1ll << y))){
      break;
    }
  }
  cout << (1ll << y) - 1 << '\n';
}

int main(){
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> t;
  while(t--){
    Solve();
  }
  return 0;
}
0