Submission #1078149

#TimeUsernameProblemLanguageResultExecution timeMemory
1078149MohamedFaresNebiliBeech Tree (IOI23_beechtree)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> #include "beechtree.h" using namespace std; vector<int> beechtree(int N, int M, vector<int> P, vector<int> C) { vector<int> ans(N, 0); vector<int> S(N, 0); for(int l = N - 2; l > 0; l--) S[l] = S[l + 1] + (C[l] == C[l + 1]); for(int l = 0; l < N; l++) ans[l] = (S[l + 1] == N - l - 1 ? 1 : 0); ans[N - 1] = 1; 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...