# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116150 | RezwanArefin01 | Werewolf (IOI18_werewolf) | C++17 | 1732 ms | 169324 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 <bits/stdc++.h>
#include "werewolf.h"
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int N = 2e5 + 10;
vi adj[N], t[N << 2];
int n, p[N], idx, vert[N];
void build(int node, int l, int r, vi &in) {
if(l == r) {
t[node].push_back(in[vert[l]]);
return;
}
int m = l + r >> 1;
build(node << 1, l, m, in);
build(node << 1 | 1, m + 1, r, in);
merge(t[node << 1].begin(), t[node << 1].end(),
t[node << 1 | 1].begin(), t[node << 1 | 1].end(),
back_inserter(t[node]));
}
bool query(int node, int l, int r, int i, int j, int x, int y) {
if(r < i || l > j) return 0;
if(i <= l && r <= j) {
vi &v = t[node];
auto L = lower_bound(v.begin(), v.end(), x);
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... |