제출 #1036971

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10369712024-07-27 20:48:52peraXOR (IZhO12_xor)C++17
0 / 100
1 ms428 KiB
#include<bits/stdc++.h>
using namespace std;
const int N = 250000 + 1 , LOG = 31;
int n , x , id = 0 , a[N] , mx[N * LOG] , t[N * LOG][2];
void UPD(int e , int o){
int v = 0;
mx[0] = max(mx[0] , o);
for(int bit = LOG - 1;bit >= 0;bit --){
if(!t[v][e >> bit & 1]){
t[v][e >> bit & 1] = ++id;
mx[t[v][e >> bit & 1]] = o;
}
v = t[v][e >> bit & 1];
}
}
int GET(int e){
int v = 0 , r = 0 , s = 0;
for(int bit = LOG - 1;bit >= 0;bit --){
int _e = e >> bit & 1;
int _x = x >> bit & 1;
if(!_x){
r = max(r , mx[t[v][!_e]]);
v = t[v][_e];
if(!v){
return r;
}
continue;
}
v = t[v][_e ^ 1];
s ^= (1 << bit);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...