제출 #872506

#제출 시각아이디문제언어결과실행 시간메모리
872506karimovDetecting Molecules (IOI16_molecules)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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