제출 #953897

#제출 시각아이디문제언어결과실행 시간메모리
9538974QT0R쌀 창고 (IOI11_ricehub)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long ll besthub(ll n, ll L, ll pos[], ll bud){ ll l,p,sm; l=p=sm=0; while(p<n-1 && sm+pos[p+1]-pos[0]<=bud){ p++; sm+=pos[p]-pos[0]; } ll mx=p+1; for (ll i = 1; i<n; i++){ sm+=(pos[i]-pos[i-1])*(i-l); sm-=(pos[i]-pos[i-1])*(p-i+1); while(sm>bud && l<i){ sm-=pos[i]-pos[l]; l++; } while(p<n-1 && sm+pos[p+1]-pos[i]<=bud){ p++; sm+=pos[p]-pos[i]; } while(l<i && p<n-1 && (pos[p+1]-pos[i])<(pos[i]-pos[l])){ sm-=pos[i]-pos[l]; l++; while(p<n-1 && sm+pos[p+1]-pos[i]<=bud){ p++; sm+=pos[p]-pos[i]; } } mx=max(mx,p-l+1); } return mx; }

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

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