제출 #474768

#제출 시각아이디문제언어결과실행 시간메모리
474768MohamedFaresNebiliDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "molecules.h" #pragma GCC optimize ("Ofast") #pragma GCC target ("avx2") using namespace std; using ll = long long; using ld = long double; using ii = pair<int, int>; using vl = vector<long long>; #define mp make_pair #define pb push_back #define pp pop_back #define ff first #define ss second #define lb lower_bound #define ub upper_bound #define all(x) (x).begin() , (x).end() const int N = 2*100005; const long long MOD = 1e9+7; const long double EPS = 0.000000001; const double PI = 3.14159265358979323846; const int nx[4]={1, -1, 0, 0}, ny[4]={0, 0, 1, -1}; long long gcd(int a, int b) { return (b==0?a:gcd(b, a%b)); } long long lcm(int a, int b) { return a*(b/gcd(a, b)); } long long fact(int a) { return (a==1?1:a*fact(a-1)); } int res=0, arr[2*100005]; void solve(int i, int l, int r, vector<int>w, int n, vector<int>a, int curr=0, int sum=0) { if(i==n) { if(sum>=l&&sum<=r) { if(curr>res) { for(int j=0;j<curr;j++) arr[j]=a[j]; } res=max(res, curr); } return; } if(sum+w[i]>r) { solve(i+1, l, r, w, n, a, curr, sum); return; } a.pb(w[i]); solve(i+1, l, r, w, n, a, curr+1, sum+w[i]); a.pp(); solve(i+1, l, r, w, n, a, curr, sum); } vector<int> find_subset(int l, int u, vector<int>w, int n, vector<int> result) { vector<int>ans; solve(0, l, u, w, n, ans); for(int i=0;i<res;i++) result.pb(arr[i]); return result; }

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

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