Submission #846789

#TimeUsernameProblemLanguageResultExecution timeMemory
846789ogkostyaBeech Tree (IOI23_beechtree)C++17
0 / 100
0 ms344 KiB
#include "beechtree.h" #include <algorithm> std::vector<int> beechtree(int N, int M, std::vector<int> P, std::vector<int> C) { std::vector<int> ans{ }; ans.push_back(1); bool sub2 = true; for (int i = N - 2; i >= 0; i--) { sub2 &= P[i+1] == i && C[i] == C[N - 1]; ans.push_back(sub2 ? 1 : 0); } std::reverse(ans.begin(), ans.end()); return ans; }
#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...