제출 #942571

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

using namespace std;

vector<int> find_subset(int l, int u, vector<int> w) {
	sort(w.begin(), w.end());
	vector<int> tab;
	for(int loop = 1; loop <= n; ++loop) {
		if(l <= w[0]*loop && w[0]*loop <= u) {
			for(int looping = 0; looping < loop; ++looping) {
				tab.push_back(w[0]);
			}
			return tab;
		}
	}
	return tab;
}

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:8:28: error: 'n' was not declared in this scope
    8 |  for(int loop = 1; loop <= n; ++loop) {
      |                            ^