Submission #403033

#TimeUsernameProblemLanguageResultExecution timeMemory
403033CursedCodeGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> #define pb push_back #define sz(v) ((int)(v).size()) #define all(v) (v).begin(), (v).end() using namespace std; typedef long long lld; lld findGap(int T, int N) { if (T == 1){ lld p = 0, q = (lld)1e18 + 1; vector <lld> arr; while(true){ lld mn, mx; MinMax(p+1, q-1, &mn, &mx); arr.pb(mn); arr.pb(mx); if (mn == mx || sz(arr) == N) break; p = mn, q = mx; } sort(all(arr)); lld ans = 0; for (int i=1;i<sz(arr);i++) ans = max(ans, arr[i]-arr[i-1]); return ans; } } return 0; }

Compilation message (stderr)

gap.cpp:29:2: error: expected unqualified-id before 'return'
   29 |  return 0;
      |  ^~~~~~
gap.cpp:30:1: error: expected declaration before '}' token
   30 | }
      | ^
gap.cpp: In function 'lld findGap(int, int)':
gap.cpp:28:2: warning: control reaches end of non-void function [-Wreturn-type]
   28 |  }
      |  ^