Submission #942571

#TimeUsernameProblemLanguageResultExecution timeMemory
942571attkyDetecting Molecules (IOI16_molecules)C++17
Compilation error
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; }

Compilation message (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) {
      |                            ^