Submission #1090223

#TimeUsernameProblemLanguageResultExecution timeMemory
1090223pmqwertyMagic Tree (CEOI19_magictree)C++17
0 / 100
27 ms13224 KiB
#include<bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 100; vector<int> a[MAXN]; int par[MAXN]; int indegree[MAXN]; int outdegree[MAXN]; int n, m, k; pair<int, int> f[MAXN]; namespace sub2{ bool check(){ for (int i = 1; i <= m; i++){ if (outdegree[f[i].second] == 0){ return false; } } return true; } void solve(){ cout << m << '\n'; } } namespace sub1{ bool check(){ return n <= 20 && k <= 20; } void solve(){ for (int i = 1; i <= n; i++){ } } } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m >> k; for (int i = 2; i <= n; i++){ int x; cin >> x; a[x].push_back(i); outdegree[x]++; indegree[x]++; } for (int i = 1; i <= m; i++){ cin >> f[i].first >> f[i].second; } if (sub2::check()) sub2::solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...