結果

問題 No.2393 Bit Grid Connected Component
ユーザー 1t0kk1t0kk
提出日時 2023-08-04 23:56:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 789 ms
コンパイル使用メモリ 71,028 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 22:19:34
合計ジャッジ時間 2,173 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <math.h>
#include <vector>

using namespace std;

typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

ll solve(ll x,ll y){
    while((x >> y) & 1)y++;
    return pow(2,y) - 1;
}

int main(){
    int T;
    cin >> T;
    ll results[T];
    rep(i,T){
        ll x,y;
        cin >> x >> y;
        results[i] = solve(x,y);
    }
    rep(i,T){
        cout << results[i] << endl;
    }
}
0