Submission #1019881

#TimeUsernameProblemLanguageResultExecution timeMemory
1019881vjudge1Detecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define int long long #define vi vector<long long> #define vvi vector<vi> #define pi pair<long long, long long> #define vpi vector<pi> #define loop(a, b) for(long long a = 0;a<b;a++) #define all(a) a.begin(), a.end() #define space << " " << #define flase false #define fasle flase using namespace std; const int VeryBigNumber = 1e18 + 42 + 1; const int VeryNiceNumber = 420 + 69; void debug(vector<int>& a, string name){ cout << name << " :"; for(int i : a){ cout << " " << i; } cout << endl; return; } vi find_subset(int l, int u, vi w){ int wnow = 0; loop(i, w.size()){ wnow += w[i]; if (wnow <= u and wnow >= l){ vi ans = {}; loop(j, i){ ans.push_back(j); } return ans; } } return {}; } /* signed main(){ vi v = find_subset(5, 7, {1, 1, 1, 1}); debug(v, "v"); return 0; } */ /* l < k*Wi < u */

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:9:41: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 | #define loop(a, b) for(long long a = 0;a<b;a++)
......
   33 |     loop(i, w.size()){
      |          ~~~~~~~~~~~                     
molecules.cpp:33:5: note: in expansion of macro 'loop'
   33 |     loop(i, w.size()){
      |     ^~~~
/usr/bin/ld: /tmp/ccJVU7Rk.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