Submission #849468

#TimeUsernameProblemLanguageResultExecution timeMemory
849468TahirAliyevGap (APIO16_gap)C++17
0 / 100
44 ms3828 KiB
#include "gap.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long

ll findGap(int T, int N)
{
    if(T == 1){
        ll a, b;
        MinMax(1, 1e18, &a, &b);
        if(N == 2){
            return b - a;
        }
        ll ans = 1;
        ll _a, _b;
        int t = 2;
        while(t < N){
            cout << a << ' ' << b << '\n';
            _a = a, _b = b;
            MinMax(a + 1, b - 1, &a, &b);
            ans = max(a - _a, ans);
            ans = max(_b - b, ans);
            t += 2;
        }
        if(N % 2 == 0){
            ans = max(ans, b - a);
        }
        return ans;
    }
    else{

    }
}

Compilation message (stderr)

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