Submission #872506

#TimeUsernameProblemLanguageResultExecution timeMemory
872506karimovDetecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back vector<long long> find_subset(long long l, long long u, vector<long long> w) { long long n = w.size(); long long left=1,right=1; vector<long long> arr(n+1); arr[0]=0; for(long long i = 1; i <= n; i++) { arr[i] = arr[i-1]+w[i-1]; } vector<long long>ans; while(right <= n) { long long x = arr[right]-arr[left-1]; // cout << x << endl; if(x < l)right++; else if(x > u)left++; if(x >= l && x <= u) { for(long long i = left-1; i < right; i++) { ans.pb(i); } break; } if(left > right)right++; } return ans; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccUnkZY3.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