# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1145677 | Math4Life2020 | Soccer Stadium (IOI23_soccer) | C++20 | 280 ms | 192216 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using pii = pair<ll,ll>;
const ll Nm = 2048; const ll E = 11; const ll INF = 1e7;
ll N;
ll ans = 0;
ll stt[Nm][2*Nm]; //y, x-segtree (coordinate of closest top point)
ll stb[Nm][2*Nm]; //same but bottom
ll nxtr[Nm][Nm];
map<ll,ll> m0[Nm+1]; //m0[top-bottom][COORDINATE COMPRESSION]->value
//COORD COMPR: (left)<<33+(right)<<22+(top)<<11+bottom
inline ll v2(ll x) {
return __builtin_ctz(x);
}
ll gtb(ll xl, ll xr, ll y0) {
if (xl>xr) {
return -1;
}
ll vl = v2(xl); ll vr = v2(xr+1);
if (vl<vr) {
return max(stb[y0][(xl>>vl)+(1<<(E-vl))],gtb(xl+(1<<vl),xr,y0));
} else {
return max(stb[y0][(xr>>vr)+(1<<(E-vr))],gtb(xl,xr-(1<<vr),y0));
}
}
ll gtt(ll xl, ll xr, ll y0) {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |