# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
629922 | stevancv | 늑대인간 (IOI18_werewolf) | C++14 | 696 ms | 74788 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"
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 2e5 + 2;
const int mod = 1e9 + 7;
vector<int> g[2][N];
int in[2][N], out[2][N], tsz;
void Dfs(int s, int o) {
in[o][s] = ++tsz;
for (int u : g[o][s]) Dfs(u, o);
out[o][s] = tsz;
}
int st[4 * N];
void Add(int node, int l, int r, int p) {
st[node]++;
if (l == r) return;
int mid = l + r >> 1;
if (p <= mid) Add(2 * node, l, mid, p);
else Add(2 * node + 1, mid + 1, r, p);
}
int Get(int node, int l, int r, int ql, int qr) {
if (r < ql || qr < l) return 0;
if (ql <= l && r <= qr) return st[node];
int mid = l + r >> 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... |