Submission #848121

#TimeUsernameProblemLanguageResultExecution timeMemory
848121math_rabbit_1028Beech Tree (IOI23_beechtree)C++17
5 / 100
70 ms16976 KiB
#include "beechtree.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; int n, m; vector<int> p, c; vector<int> adj[202020]; vector<int> beechtree(int N, int M, vector<int> P, vector<int> C) { n = N; m = M; p = P; c = C; for (int i = 0; i < n; i++) { adj[p[i]].push_back(i); } vector<int> res(n); int ans = 1; for (int i = n - 1; i >= 0; i--) { res[i] = ans; if (c[i] != c[n - 1]) ans = 0; } return res; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...