답안 #1092402

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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;
}

Compilation message

coreputer.cpp:1:6: error: 'vector' in namespace 'std' does not name a template type
    1 | std::vector<int> malfunctioning_cores(int n) {
      |      ^~~~~~
coreputer.cpp:1:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
  +++ |+#include <vector>
    1 | std::vector<int> malfunctioning_cores(int n) {