結果

問題 No.2393 Bit Grid Connected Component
ユーザー McGregorshMcGregorsh
提出日時 2023-07-29 18:29:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 977 bytes
コンパイル時間 2,234 ms
コンパイル使用メモリ 196,624 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 23:37:13
合計ジャッジ時間 4,004 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<cassert>
#include <bits/stdc++.h>
#include <queue>
#include <set>
#include<algorithm> 
#include <math.h>
#include <bitset>
using namespace std;

vector<bool> make_is_prime(int N) {
    vector<bool> prime(N + 1, true);
    if (N >= 0) prime[0] = false;
    if (N >= 1) prime[1] = false;
    for (int i = 2; i * i <= N; i++) {
        if (!prime[i]) continue;
        for (int j = i * i; j <= N; j += i) {
            prime[j] = false;
        }
    }
    return prime;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int T;
	cin >> T;
	for (int i=0; i<T; i++){
	    int A, B;
	    cin >> A >> B;
	    bitset<64> bs1(A);
	    int point = 64 - (B+1);
	    if (bs1.test(point)){
	        cout << 0 << endl;
	    }
	    else{
	        for (int j=0; j<100; j++){
	            int score = pow(2, j);
	            if (score > A){
	                cout << score-1 << endl; 
	                break;
	            }
	        }
	    }
	}
	
}
0