# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
135054 | miguel | Railway (BOI17_railway) | C++14 | 171 ms | 24180 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;
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define sz size()
#define x first
#define y second
#define pi pair <int, int>
#define pii pair <int, pi>
#define vi vector <int>
#define nmax 301
const ll mod = 998244353;
int n, m, k, timer, up[100001][18], tin[100001], tout[100001], cnt[100001];
vi g[100001];
pi ed[100001];
void dfs(int nod, int p){
tin[nod]=timer++;
up[nod][0]=p;
for(int i=1; i<=17; i++) up[nod][i]=up[up[nod][i-1]][i-1];
for(int i : g[nod]){
if(i!=p) dfs(i, nod);
}
tout[nod]=timer++;
}
bool check(int anc, int x){
if(tin[anc]<=tin[x] && tout[x]<=tout[anc]) return 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |