제출 #992561

#제출 시각아이디문제언어결과실행 시간메모리
992561Khanhcsp2휴가 (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<int, vector<int>, greater<int>> q; int a[N], b[N]; ll findMaxAttraction(int n, int start, int d, int att[]) { for(ll i=0;i<n;i++) a[i+1]=att[i]; ll sum=0, ans=a[1]; if(d==0) return 0ll; for(int i=1;i<d;i++) q.push(0); sum+=a[1]; q.push(a[1]); for(int 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(int 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); // int t=1; // //cin >> t; // while(t--) // { // sol(); // } //}

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

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