結果

問題 No.1674 Introduction to XOR
ユーザー sapphire__15sapphire__15
提出日時 2021-09-10 21:30:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,499 bytes
コンパイル時間 1,830 ms
コンパイル使用メモリ 124,424 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-02 16:02:27
合計ジャッジ時間 2,688 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <cmath>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>

#define rep(i,n,s) for(int i = (s); i < int(n); i++)
#define MM << " " << 
#define all(x) x.begin(), x.end()

template<class T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

using ll = long long;
using Pii = std::pair<int, int>;
using Pll = std::pair<ll, ll>;

template<class T>
bool chmin(T& a, const T b) {
    if(a > b) {
        a = b;
        return true;
    } else {
        return false;
    }
}

template<class T>
bool chmax(T& a, const T b) {
    if(a < b) {
        a = b;
        return true;
    } else {
        return false;
    }
}

template<class T>
void vdeb(std::vector<T> &da) {
    auto n = da.size();
    for(size_t i = 0; i < n; i++) {
        if(i == n-1) std::cout << da[i] << std::endl;
        else std::cout << da[i] << " ";
    }
}
template<>
void vdeb(std::vector<std::string> &da) {
    auto n = da.size();
    for(size_t i = 0; i < n; i++) {
        std::cout << da[i] << std::endl;
    }
}

using namespace std;

int main() {
    int n; cin >> n;
    vector<ll> da(n);
    rep(i,n,0) cin >> da[i];
    ll mask = 0;
    rep(i,n,0) mask |= da[i];
    ll ans = 1;
    while(ans&mask) {
        ans <<= 1;
    }
    cout << ans << endl;
}
0