CSES - APIO 2016 - Results
Submission details
Task:Gap
Sender:Lieska
Submission time:2019-04-13 11:59:02 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:22:5: error: redefinition of 'int main()'
 int main(){}
     ^~~~
In file included from input/code.cpp:2:0:
input/gap.h:45:5: note: 'int main()' previously defined here
 int main() {
     ^~~~
input/code.cpp: In function 'll FindGap(ll, ll)':
input/code.cpp:21:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Code

#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
ll FindGap(ll a, ll b){
    if (a==1){
        ll c=0, d=1e18, t[100001], s=0, mn, mx;
        for (int i=1; i<=(b+1)/2; ++i){
            MinMax(c, d, &mn, &mx);
            t[i]=mn;
            t[b+1-i]=mx;
            c=mn-1;
            d=mx-1;
        }
        for (int i=1; i<b; ++i){
            c=t[i+1]-t[i];
            if (c>s) s=c;
        }
        return s;
    }
}
int main(){}