제출 #338650

#제출 시각아이디문제언어결과실행 시간메모리
338650bigDuckGap (APIO16_gap)C++14
0 / 100
49 ms1260 KiB
#include "gap.h"

#include<bits/stdc++.h>
using namespace std;
#define INIT  ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define mp make_pair
#define pb push_back
#define ft first
#define sc second
#define ll long long
#define pii pair<int, int>
#define count_bits __builtin_popcount
#define int ll


int n;
int l1, r1;
int subtask_1(){

int l=0, r=(1e18)+1;
int mx=0;
int cnt=0;
while(cnt<n){

    MinMax(l+1, r-1, &l1, &r1);
    if(cnt>0){
        mx=max(l1-l, r-r1);
    }
    cnt+=2;
    l=l1, r=r1;
    //cout<<l<<" "<<r<<flush;
}
mx=max(mx, r-l);
return mx;
}


long long findGap(int32_t T, int32_t N)
{
    n=N;
    if(T==1){
        return subtask_1();
    }
}

컴파일 시 표준 에러 (stderr) 메시지

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