Submission #560223

#TimeUsernameProblemLanguageResultExecution timeMemory
560223Trisanu_DasGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" #define int long long int using namespace std; int findGap(int type, int n){ int ma, mi, ans; MinMax(0, 2e18, &mi, &ma); if(type == 1){ for(int i = 1; i < (n + 1) / 2; ++i){ int currma, currmi; MinMax(mi + 1, ma - 1, &currmi, &currma); ans = max(ans, max(currmi - mi, ma - currma)); mi = currmi; ma = currma; } return ans = max(ans, ma - mi); } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
gap.cpp:7:15: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
    7 |   int ma, mi, ans;
      |               ^~~
/usr/bin/ld: /tmp/ccxiz0wh.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status