제출 #536163

#제출 시각아이디문제언어결과실행 시간메모리
536163mario05092929Gap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[100005]; int lp,rp; long long findGap(int T, ll n) { ll l = 0, r = 1e18,mn,mx; if(T & 1) { MinMax(l,r,&mn,&mx); lp = 1, rp = n; while(1) { a[lp++] = mn; a[rp--] = mx; l = mn+1, r = mx-1; if(lp > rp) break; MinMax(l,r,&mn,&mx); } ll mxx = 0; for(int i = 1;i < n;i++) { mxx = max(mxx,a[i+1]-a[i]); } return mxx; } else { MinMax(l,r,&mn,&mx); ll diff = 0; ll len = (mx-mn)/n+1; ll st = mn+1; ll tmn,tmx; for(int i = 1;i <= n;i++) { MinMax(st,st+len,&tmn,&tmx); if(tmn == -1) continue; diff = max(diff,tmn-mn); mn = tmx; } return diff; } }

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

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