Submission #1217077

#TimeUsernameProblemLanguageResultExecution timeMemory
1217077moondarksideDetecting Molecules (IOI16_molecules)C++20
Compilation error
0 ms0 KiB
vector<int> find_subset( int l, int u, vector<int> w ) { sort(w.begin(),w.end()); if(w[0]>u){ return vector<int>(); } int weight=0; std::queue<int> Solution; for(int i=0;i<w.size();i++){ if(weight>=l && weight<=u){ vector<int> Sol; while(!Solution.empty()){ Sol.push_back(Solution.front()); Solution.pop(); } return Sol; } if(weight<l){ Solution.push(i); weight+=w[i]; } else{ weight-=w[Solution.front()]; Solution.pop(); } } return vector<int>(); }

Compilation message (stderr)

molecules.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> find_subset( int l, int u, vector<int> w ) {
      | ^~~~~~
molecules.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~