제출 #464721

#제출 시각아이디문제언어결과실행 시간메모리
464721nickmet2004Gap (APIO16_gap)C++11
0 / 100
54 ms1096 KiB
#include<bits/stdc++.h> #include "gap.h" #define ll long long using namespace std; ll findGap(int T , int n){ ll ans = 0; ll x = 0 , y = 1e18 ,mn , mx; if(T == 1){ for(int i = 1; i < (n + 1) /2; ++i){ MinMax(x , y , &mn , &mx); if(x) ans = max(ans , mn - x + 1); if(y != 1e18) ans = max(ans , y - mx + 1); x = mn + 1; y = mx - 1; } } return max(ans , mx-mn); //1 2 3 4 5 6 }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:18:24: warning: 'mx' may be used uninitialized in this function [-Wmaybe-uninitialized]
   18 |     return max(ans , mx-mn);
      |                      ~~^~~
gap.cpp:18:24: warning: 'mn' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...