Submission #132799

#TimeUsernameProblemLanguageResultExecution timeMemory
132799redaDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std ;
 vector<int>find_subset(int l, int r, vector<int> w)
{
    vector<int> ans;
    int c=0;
for(int i=0;i<w.size();i++)
{
    if(c+w[i]<=r && c+w[i]>=l)
    {
    c+=w[i];
    ans.push_back(w[i]);
    }
    else break; 
}
return ans;
return 0;
}

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:7:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 for(int i=0;i<w.size();i++)
             ~^~~~~~~~~
molecules.cpp:17:8: error: could not convert '0' from 'int' to 'std::vector<int>'
 return 0;
        ^