제출 #992558

#제출 시각아이디문제언어결과실행 시간메모리
992558Khanhcsp2휴가 (IOI14_holiday)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define el '\n' #define fi first #define sc second #define int ll #define pii pair<int, int> #define all(v) v.begin(), v.end() using namespace std; using ll=long long; using ull=unsigned long long; using ld=long double; const int mod=1e9+7; const int N=1e5+11; priority_queue<ll, vector<ll>, greater<ll>> q; ll a[N], n, b[N], s, d; ll findMaxAttraction(ll n, ll start, ll d, ll attraction[]) { for(ll i=0;i<n;i++) a[i+1]=attraction[i]; ll sum=0, ans=a[1]; if(d==0) return 0; for(ll i=1;i<d;i++) q.push(0); sum+=a[1]; q.push(a[1]); for(ll i=2;i<=n;i++) { sum+=a[i]; q.push(a[i]); sum-=q.top(); q.pop(); sum-=q.top(); q.pop(); ans=max(ans, sum); if(q.empty()) break; } return ans; } //void sol() //{ // cin >> n >> s >> d; // for(ll i=0;i<n;i++) cin >> b[i]; // cout << findMaxAttraction(n, s, d, b); //} //signed main() //{ //// freopen("divisor.INP", "r", stdin); //// freopen("divisor.OUT", "w", stdout); // ios_base::sync_with_stdio(0); // cin.tie(0); // ll t=1; // //cin >> t; // while(t--) // { // sol(); // } //}

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

/usr/bin/ld: /tmp/cc9oEX70.o: in function `main':
grader.cpp:(.text.startup+0xaf): undefined reference to `findMaxAttraction(int, int, int, int*)'
collect2: error: ld returned 1 exit status