Submission #167860

#TimeUsernameProblemLanguageResultExecution timeMemory
167860stefdascaGap (APIO16_gap)C++14
0 / 100
35 ms3192 KiB
#include<bits/stdc++.h> #include "gap.h" using namespace std; long long v[100002]; long long findGap(int T, int N) { long long ans = 0; if(T == 1) { int a = 1; int b = N; long long st = 0; long long dr = 1; for(int i = 1; i <= 18; ++i) dr = dr * 10LL; while(a <= b) { long long *st2; long long *dr2; MinMax(st, dr, st2, dr2); v[a] = *st2; v[b] = *dr2; ++a; --b; st = *st2; dr = *dr2; } for(int i = 1; i < N; ++i) ans = max(ans, v[i+1] - v[i]); } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:22:19: warning: 'st2' may be used uninitialized in this function [-Wmaybe-uninitialized]
             MinMax(st, dr, st2, dr2);
             ~~~~~~^~~~~~~~~~~~~~~~~~
gap.cpp:22:19: warning: 'dr2' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...