Submission #589433

#TimeUsernameProblemLanguageResultExecution timeMemory
589433KrisjanisPDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> ii; std::vector<int> find_subset(int l, int u, std::vector<int> w) { ll curW = 0, curI=0; while(curI<w.size()&&curW<l) curW += w[curI++]; if(curW<l||curW>r) return {}; vector<int> res; for(ll i=0;i<curI;i++) res.push_back(i); return res; }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:9:15: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     while(curI<w.size()&&curW<l)
      |           ~~~~^~~~~~~~~
molecules.cpp:11:21: error: 'r' was not declared in this scope
   11 |     if(curW<l||curW>r) return {};
      |                     ^