Submission #1078171

#TimeUsernameProblemLanguageResultExecution timeMemory
1078171MohamedFaresNebiliBeech 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> P(N, 0); for(int l = 2; l < N; l++) P[l] = P[l - 1] + (C[l] == C[l - 1]); for(int l = 0; l < N; l++) { if(P[N - 1] - P[l] == N - l - 2) ans[l] = 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...