# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
908244 | zyq181 | Coreputer (IOI23_coreputer) | C++17 | 0 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "coreputer.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> malfunctioning_cores(int N){
int num;
vector<int> them;
int cur;
bool flag = false;
int ret;
vector<int> q;
for(int a=1; a<=N; a++){
cur = a-1;
q.push_back(a-1);
ret = run_diagnostic(q);
if(ret != -1){
them.push_back(cur);
flag = true;
break;
}
}
for(int a=cur+1; a<N; a++){
q.pop_back();
q.push_back(a);
if(run_diagnostic(q) != -1){
them.push_back(a);
}
}
int cmp = them.size(); //either half + 1 or half + 1/2
int k;
if(ret == 1){
num = cmp + cmp - 1; //cmp - 1
k = cmp;
}
else{
num = 2 * cmp - 2; //cmp - 2
k = cmp - 1;
}
q.clear();
for(int a=0; a<k; a++){
q.push_back(them[a]);
}
for(int a=0; a<cur; a++){
q.pop_back();
q.push_back(a);
if(run_diagnostic(q) != -1){
them.push_back(a);
}
}
return q;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |