Submission #72935

#TimeUsernameProblemLanguageResultExecution timeMemory
72935FedericoSDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include <algorithm> #include "molecules.h" using namespace std; typedef long long int ll; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<ll> V; ll N=w.size(); ll S=0; vector<pair<ll,ll>> W; for(ll i=0;i<N;i++) W.push_back({w[i],i}); sort(W.begin(), W.end()); for(ll a=0,b=0;a<N;a++){ S-=a?W[a-1].first:0; while(l>S and b<N) S+=W[b++].first; if(l<=S and S<=u){ for(ll i=a;i<b;i++) V.push_back(W[i].second); return V; } } return V; }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:24:14: error: could not convert 'V' from 'std::vector<long long int>' to 'std::vector<int>'
       return V;
              ^
molecules.cpp:28:12: error: could not convert 'V' from 'std::vector<long long int>' to 'std::vector<int>'
     return V;
            ^