제출 #813009

#제출 시각아이디문제언어결과실행 시간메모리
813009PikachuGap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std; template<typename T> inline bool maxi(T &x, const T &val) { if (x < val) return x = val, true; return false; } template<typename T> inline bool mini(T &x, const T &val) { if (x > val) return x = val, true; return false; } const int maxn = 1e5 + 10, oo = 1e18; int n; int a[maxn]; int res; void MinMax(long long s, long long t, long long *mn, long long *mx); int solve1() { int st = 0, en = oo; int *tmpn = new int(0), *tmpx = new int(oo); int curst = 1, curen = n; while (curst <= curen) { MinMax(st, en, tmpn, tmpx); a[curst++] = *tmpn; st = *tmpn + 1; a[curen--] = *tmpx; en = *tmpx - 1; } for (int i = 1; i < n; i++) { maxi(res, a[i + 1] - a[i]); } return res; } int solve2() { } int findGap(int sub, int n) { ::n = n; if (sub == 1) return solve1(); else return solve2(); }

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

gap.cpp: In function 'long long int solve2()':
gap.cpp:48:1: warning: no return statement in function returning non-void [-Wreturn-type]
   48 | }
      | ^
/usr/bin/ld: /tmp/cciLnum2.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status