Submission #1077067

#TimeUsernameProblemLanguageResultExecution timeMemory
1077067TrentBeech Tree (IOI23_beechtree)C++17
5 / 100
44 ms6744 KiB
#include "beechtree.h" #include "bits/stdc++.h" using namespace std; #define forR(i, x) for(int i = 0; i < (x); ++i) #define REP(i, a, b) for(int i = (a); i < (b); ++i) #define all(x) x.begin(), x.end() #define asst(x) if(!(x)) exit(2) typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<vi> vvi; typedef vector<vll> vvll; std::vector<int> beechtree(int N, int M, std::vector<int> P, std::vector<int> C) { vi ret(N); bool can = true; int lasCol = -1; for(int i = N-1; i >= 0; --i) { if(can) { ret[i] = 1; if(lasCol == -1) lasCol = C[i]; else can = can && C[i] == lasCol; } else { ret[i] = 0; } } return ret; }
#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...