제출 #848115

#제출 시각아이디문제언어결과실행 시간메모리
848115math_rabbit_1028참나무 (IOI23_beechtree)C++17
0 / 100
2 ms4952 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 >= 1; 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...