Submission #407407

#TimeUsernameProblemLanguageResultExecution timeMemory
407407Blobo2_Blobo2Gap (APIO16_gap)C++14
30 / 100
46 ms1940 KiB
#include "gap.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; long long findGap(int T, int N){ long long ans=0; long long arr[N],idx=0,mx,mn,l=0,r=1e18; for(int i=0;i<N/2+(N%2);i++){ MinMax(l,r,&mn,&mx); arr[i]=mn; arr[N-i-1]=mx; l=mn+1; r=mx-1; } for(int i=0;i<N-1;i++) ans=max(ans,arr[i+1]-arr[i]); return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:8:22: warning: unused variable 'idx' [-Wunused-variable]
    8 |     long long arr[N],idx=0,mx,mn,l=0,r=1e18;
      |                      ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...