제출 #284834

#제출 시각아이디문제언어결과실행 시간메모리
284834triplem5dsGap (APIO16_gap)C++14
0 / 100
40 ms1272 KiB
#include "gap.h" #include "bits/stdc++.h" using namespace std; long long findGap(int T, int N) { long long ans = 0; if(T == 2){ long long cur = 0; vector<long long > vr; for(int i = 0; i < N; i++){ long long * mn, * mx; MinMax(cur, cur, mn, mx); vr.push_back(*mn); cur = *mn + 1; if(i)ans = max(ans, vr[i] - vr[i-1]); } } return ans; }

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

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