제출 #873445

#제출 시각아이디문제언어결과실행 시간메모리
873445CutebolDetecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std ; #define endl '\n' #define int long long vector <int> ans ; vector <pair <int , int>> vec ; std::vector<int> find_subset(int l, int u, vector<int> w) { int sum = 0 , x = 0 ; int n = w.size() ; for ( int i = 0 ; i < n ; i ++ ) vec.push_back({w[i],i}) ; sort ( vec.begin() , vec.end() ) ; for ( int i = 0 ; i < n ; i ++ ){ sum += vec[i].first ; while ( sum > u && x < n ) sum -= vec[x].first , x ++ ; if ( x == n && sum > u ) return ans ; if ( sum >= l ){ for ( int j = x ; j <= i ; j ++ ) ans.push_back(vec[j].second) ; break ; } } sort ( ans.begin() , ans.end() ) ; return ans ; }

컴파일 시 표준 에러 (stderr) 메시지

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