제출 #226710

#제출 시각아이디문제언어결과실행 시간메모리
226710urd05휴가 (IOI14_holiday)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int n; int st; int d; long long arr[100000]; long long findMaxAttraction(int nn,int start,int dd,long long at[]) { n=nn; st=start; d=dd; for(int i=0;i<n;i++) { arr[i]=at[i]; } long long ret=0; long long sum=0; priority_queue<long long,vector<long long>,greater<long long>> pq; for(int i=st;i>=0;i--) { while (!pq.empty()) { pq.pop(); } sum=0; for(int j=i;j<n;j++) { pq.push(arr[j]); sum+=arr[j]; while ((int)pq.size()>d-st-j+2*i&&!pq.empty()) { sum-=pq.top(); pq.pop(); } ret=max(ret,sum); } } for(int i=st;i<n;i++) { while (!pq.empty()) { pq.pop(); } sum=0; for(int j=i;j>=0;j--) { pq.push(arr[j]); sum+=arr[j]; while ((int)pq.size()>d+j+st-2*i&&!pq.empty()) { sum-=pq.top(); pq.pop(); } } ret=max(ret,sum); } return ret; }

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

/tmp/cccO5POI.o: In function `main':
grader.cpp:(.text.startup+0x89): undefined reference to `findMaxAttraction(int, int, int, int*)'
collect2: error: ld returned 1 exit status