Submission #132907

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1329072019-07-19 23:14:50KieranHorganMeetings (IOI18_meetings)C++17
19 / 100
5537 ms21872 KiB
#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];
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...