# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
796276 | Johann | Tourism (JOI23_tourism) | C++14 | 5045 ms | 22396 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"
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
int N, M, Q;
vi C;
vector<set<int>> CC;
vvi adj;
vi in, out;
vvi vorg;
// void dfs(int v, int p, int &idx);
int solve(int v, int p, int l, int r)
{
int ans = 0;
for (int u : adj[v])
if (u != p)
ans += solve(u, v, l, r);
auto it = CC[v].lower_bound(l);
if ((it != CC[v].end() && *it < r) || ans)
++ans;
return ans;
}
int main()
{
ios::sync_with_stdio(false);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |