제출 #1035975

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10359752024-07-26 22:39:08peraXOR (IZhO12_xor)C++17
0 / 100
64 ms83544 KiB
#include<bits/stdc++.h>
using namespace std;
const int N = 250000 + 1 , LOG = 3;
int n , x , T = 0;
map<int , int> POS;
vector<int> p(N);
vector<vector<int>> t(N * LOG , vector<int>(2)) , mx(N * LOG , vector<int>(2));
void UPD(int u , int e){
int v = 0;
for(int bit = LOG - 1;bit >= 0;bit --){
if(!t[v][u >> bit & 1]){
t[v][u >> bit & 1] = ++T;
mx[v][u >> bit & 1] = e;
}
v = t[v][u >> bit & 1];
}
}
int GET(int u){
int v = 0 , s = -1;
for(int bit = LOG - 1;bit >= 0;bit --){
int _u = u >> bit & 1;
int _x = v >> bit & 1;
if(_x){
v = t[v][_u ^ 1];
if(v == 0){
return s;
}
continue;
}
s = max(s , mx[v][_u ^ 1]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...