結果

問題 No.2977 Kth Xor Pair
ユーザー SnowBeenDiding
提出日時 2024-12-01 01:40:49
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
MLE  
実行時間 -
コード長 1,247 bytes
コンパイル時間 8,192 ms
コンパイル使用メモリ 351,516 KB
実行使用メモリ 814,792 KB
最終ジャッジ日時 2024-12-01 01:41:50
合計ジャッジ時間 57,750 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 MLE * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <atcoder/all>
#include <bits/stdc++.h>

using mint = atcoder::modint998244353;
const long long mod = 998244353;

#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define repreq(i, a, b) for (ll i = (ll)(a); i >= (ll)(b); i--)
#define sortr(v) sort(v, greater<>())
#define PI acos(-1.0L)
#define TAU (PI * 2.0L)

using namespace atcoder;
using namespace std;

typedef long long ll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
    int n = v.size();
    for (int i = 0; i < n; i++) {
        os << v[i] << " \n"[i == n - 1];
    }
    return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
    int n = v.size();
    for (auto &x : v)
        os << x;
    return os;
}

void solve();

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(0);
    cout.precision(12);
    cout << fixed;
    solve();
}

void solve() {
    int n, k;
    cin >> n >> k;
    k--;
    vector<ll> a(n);
    rep(i, 0, n) cin >> a[i];
    vector<ll> b;
    rep(i, 0, n) rep(j, i + 1, n) b.push_back(a[i] ^ a[j]);
    sort(b.begin(), b.end());
    cout << b[k] << endl;
}
0