# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
330921 | ZwariowanyMarcin | XOR (IZhO12_xor) | C++14 | 2045 ms | 94188 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define sz(x) (int)x.size()
using ll = long long;
using namespace std;
const int M = 8000000;
int n, q, a, b, cnt, to[M][2], mn[M];
pair<int, int> res;
int add(int pos, int x) {
int v = 0;
for (int i = 30; 0 <= i; --i) {
int b = (x >> i & 1);
if (!to[v][b]) to[v][b] = ++cnt;
v = to[v][b];
mn[v] = min(mn[v], pos);
}
}
int query(int x) {
int v = 0, res = 1 << 30;
for (int i = 30; 0 <= i; --i) {
int b = (x >> i & 1);
if (q >> i & 1)
v = to[v][!b];
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |