# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82718 | zubec | Werewolf (IOI18_werewolf) | C++14 | 894 ms | 50212 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 "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
vector <int> g[N];
int a[N], pos[N], t[2][20][N], n, st[N];
void build(){
st[1] = 0;
for (int i = 2; i <= n; i++)
st[i] = st[i/2] + 1;
for (int i = 0; i < n; i++){
t[0][0][i] = t[1][0][i] = a[i];
}
for (int i = 1; i < st[n]; i++){
for (int j = 0; j < n-(1<<i)+1; j++){
t[0][i][j] = min(t[0][i-1][j], t[0][i-1][j+(1<<(i-1))]);
t[1][i][j] = max(t[1][i-1][j], t[1][i-1][j+(1<<(i-1))]);
}
}
}
int getMn(int l, int r){
int sz = st[(r-l+1)];
return min(t[0][sz][l], t[0][sz][r-(1<<sz)+1]);
}
Compilation message (stderr)
# | 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... |