제출 #161517

#제출 시각아이디문제언어결과실행 시간메모리
161517kostia244Detecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include "molecules.h"
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
using vi = vector<int>;
vi find_subset(int l, int u, std::vector<int> w) {
	vi t;
	for(int i = 0; i < n; i++) {
		t.pb(w[0]);
		if((i+1)*w[0]==l)return t;
	}
	return {};
}

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

molecules.cpp: In function 'vi find_subset(int, int, std::vector<int>)':
molecules.cpp:11:21: error: 'n' was not declared in this scope
  for(int i = 0; i < n; i++) {
                     ^