제출 #614327

#제출 시각아이디문제언어결과실행 시간메모리
614327shezittDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include "molecules.h"
#include <bits/stdc++.h>

using namespace std;

// Subtask 1

vector<int> find_subset(int l, int u, vector<int> w) {
	int x = w[0], n = w.size();
	if(x == l && x == u){
		return {0};
	}
	int i;
	for(i=0, aux=0; i<n && aux < l; ++i){
		aux += x;
	}
	if(aux >= l && aux <= u){
		vector<int> ans(i);
		iota(ans.begin(), ans.end(), 0);
		return ans;
	}
	return {};
}

컴파일 시 표준 에러 (stderr) 메시지

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:14:11: error: 'aux' was not declared in this scope
   14 |  for(i=0, aux=0; i<n && aux < l; ++i){
      |           ^~~
molecules.cpp:17:5: error: 'aux' was not declared in this scope
   17 |  if(aux >= l && aux <= u){
      |     ^~~