제출 #304754

#제출 시각아이디문제언어결과실행 시간메모리
304754rocks03Gap (APIO16_gap)C++14
0 / 100
35 ms1164 KiB
#include "gap.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;

void MinMax(long long s, long long t, long long *mn, long long *mx);

long long findGap(int T, int N){
	if(T == 1){
        ll arr[N];
        ll l = 0, r = LLONG_MAX;
        for(int i = 0, j = N-1; i <= j; i++, j--){
            ll *mn, *mx;
            MinMax(l, r, mn, mx);
            arr[i] = *mn, arr[j] = *mx;
            l = arr[i] + 1, r = arr[j] - 1;
        }
        ll ans = 0;
        for(int i = 1; i < N; i++){
            ans = max(ans, arr[i] - arr[i-1]);
        }
        return ans;
	}
	return 0;
}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:14:19: warning: 'mn' may be used uninitialized in this function [-Wmaybe-uninitialized]
   14 |             MinMax(l, r, mn, mx);
      |             ~~~~~~^~~~~~~~~~~~~~
gap.cpp:14:19: warning: 'mx' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...