# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
348588 | Nima_Naderi | Klasika (COCI20_klasika) | C++14 | 1213 ms | 524288 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
///In the name of GOD
//#pragma GCC optimize("O2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
const ll MXN = 4e5 + 10;
const ll LOG = 31;
const ll MXM = MXN * LOG + 10;
const ll INF = 1e8;
ll cntr;
ll L[MXM], R[MXM], mtm[MXM];
void Pak(ll u = 1, ll bit = LOG - 1){
mtm[u] = INF;
if(L[u]) Pak(L[u], bit - 1), L[u] = 0;
if(R[u]) Pak(R[u], bit - 1), R[u] = 0;
}
void Add(ll val, ll tm, ll u = 1, ll bit = LOG - 1){
mtm[u] = min(mtm[u], tm);
if(bit == -1) return;
if((val >> bit) & 1LL){
if(!R[u]) R[u] = cntr ++;
Add(val, tm, R[u], bit - 1);
}
else{
if(!L[u]) L[u] = cntr ++;
Add(val, tm, L[u], bit - 1);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |