# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132907 | KieranHorgan | Meetings (IOI18_meetings) | C++17 | 5537 ms | 21872 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.
#include "meetings.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
#define int long long
int N, Q;
vector<signed> H,L,R;
int ST[MAXN][20];
int lg(signed x) {return 31 - __builtin_clz(x);}
void buildST() {
for(int i = 0; i < N; i++)
ST[i][0] = i;
for(int j = 1; j < 20; j++)
for(int i = 0; i + (1<<j) <= N; i++) {
if(H[ST[i][j-1]] > H[ST[i+(1<<(j-1))][j-1]]) {
ST[i][j] = ST[i][j-1];
}
if(H[ST[i][j-1]] < H[ST[i+(1<<(j-1))][j-1]]) {
ST[i][j] = ST[i+(1<<(j-1))][j-1];
}
if(H[ST[i][j-1]] == H[ST[i+(1<<(j-1))][j-1]]) {
if(rand()%2)
ST[i][j] = ST[i][j-1];
else
ST[i][j] = ST[i+(1<<(j-1))][j-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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |