# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1092402 | 2024-09-24T02:17:04 Z | Luvidi | Coreputer (IOI23_coreputer) | C++17 | 0 ms | 0 KB |
std::vector<int> malfunctioning_cores(int n) { int idx,s; vector<int> v; for(int i=0;i<n;i++){ v.push_back(i); int x=run_diagnostic(v); if(x!=-1){ s=x; idx=i; break; } } vector<int> ans(n); if(s){ v.pop_back(); for(int i=idx;i<n;i++){ v.push_back(i); ans[i]=run_diagnostic(v)==1; v.pop_back(); } v.clear(); for(int i=idx+1;i<n;i++)v.push_back(i); for(int i=0;i<idx;i++){ v.push_back(i); ans[i]=run_diagnostic(v)==1; v.pop_back(); } }else{ for(int i=idx+1;i<n;i++){ v.push_back(i); ans[i]=run_diagnostic(v)==1; v.pop_back(); } v.clear(); for(int i=idx+1;i<n;i++)v.push_back(i); for(int i=0;i<=idx;i++){ v.push_back(i); ans[i]=run_diagnostic(v)==1; v.pop_back(); } } return ans; }