Submission #469889

#TimeUsernameProblemLanguageResultExecution timeMemory
469889IvnFDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include "molecules.h" std::vector<long long> find_subset(long long l, long long u, std::vector<long long> w) { long long kiri=0, sums=0, n=w.size(); for(long long i=0;i<n;++i){ sums+=w[i]; while(sums > u){ sums-=w[l++]; } if(sums>=l && sums<=u){ std::vector<long long>ans; for(int j=l;j<=i;++j){ ans.push_back(j); } return ans; } } }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<long long int> find_subset(long long int, long long int, std::vector<long long int>)':
molecules.cpp:4:15: warning: unused variable 'kiri' [-Wunused-variable]
    4 |     long long kiri=0, sums=0, n=w.size();
      |               ^~~~
molecules.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
/usr/bin/ld: /tmp/cc1p0OAO.o: in function `main':
grader.cpp:(.text.startup+0x18d): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status