Submission #679160

#TimeUsernameProblemLanguageResultExecution timeMemory
679160tigarGap (APIO16_gap)C++14
0 / 100
37 ms1080 KiB
#include <bits/stdc++.h>
#include "gap.h"

using namespace std;

typedef long long ll;

ll mn, mx;

ll findGap(int T, int N)
{
    if(T==1)
    {
        ll up_bound=LONG_LONG_MAX, low_bound=0;
        MinMax(low_bound, up_bound, &mn, &mx);
        ll a=mn, b=mx;
        ll razlika=0;
        while(mn!=-1 and up_bound>=low_bound)
        {
            MinMax(low_bound, up_bound, &mn, &mx);
            razlika=max(razlika, max(mn-a, b-mx));
            low_bound=mn+1; up_bound=mx-1;
        }
        return razlika;
    }
}

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...