Submission #980012

#TimeUsernameProblemLanguageResultExecution timeMemory
980012canadavid1Coreputer (IOI23_coreputer)C++17
60 / 100
1 ms596 KiB
#include "coreputer.h" std::vector<int> malfunctioning_cores(int N) { std::vector<int> c; if(run_diagnostic(c)==0) return std::vector<int>(N,0); int mal = -1; int a; for(int i = 0; i < N; i++) { c.push_back(i); a = run_diagnostic(c); if(a!=-1) { mal = i; break; } } std::vector<int> malfunc(N); malfunc[mal] = 1; for(int i = mal+1; i < N; i++) { c.pop_back(); c.push_back(i); if(run_diagnostic(c)==a) malfunc[i] = true; } c.pop_back(); c.push_back(mal); for(int i = 0; i < mal; i++) { auto j = c.begin(); for(;*j !=i; j++); c.erase(j); if(run_diagnostic(c)!=a) malfunc[i] = true; c.push_back(i); } return malfunc; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...