제출 #529495

#제출 시각아이디문제언어결과실행 시간메모리
529495happypotatoGap (APIO16_gap)C++17
30 / 100
42 ms1140 KiB
#include "gap.h" #include <bits/stdc++.h> #define ll long long using namespace std; ll mn, mx; ll st1(int n) { ll s = 0, t = 1e18; MinMax(s, t, &mn, &mx); ll ans = 0; for (int i = 2; i <= n / 2; i++) { ll pmn = mn, pmx = mx; MinMax(mn + 1, mx - 1, &mn, &mx); ans = max(ans, mn - pmn); ans = max(ans, pmx - mx); } if (n % 2 == 1) { ll fin, fin2; MinMax(mn + 1, mx - 1, &fin, &fin2); ans = max(ans, fin - mn); ans = max(ans, mx - fin); } else { ans = max(ans, mx - mn); } return ans; } ll st2(int n) { } long long findGap(int T, int N) { if (T == 1) return st1(N); else return st2(N); }

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

gap.cpp: In function 'long long int st2(int)':
gap.cpp:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
   28 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...