제출 #151905

#제출 시각아이디문제언어결과실행 시간메모리
151905Ruxandra985Gap (APIO16_gap)C++14
30 / 100
56 ms3804 KiB
#include <cstdio> #include "gap.h" long long findGap (int t , int n){ int l,r,i; long long st,dr,a,b,sol; if (t == 1){ long long w[100010]; st = 1; dr = 1000000000000000000; l = 1; r = n; while (l<=r){ a=b=0; MinMax (st,dr,&a,&b); if (l < r){ w[l] = a; w[r] = b; } else { w[l] = a; } st = a + 1; dr = b - 1; l++; r--; } sol = 0; for (i=2;i<=n;i++){ if (sol < w[i] - w[i-1]) sol = w[i] - w[i-1]; } return sol; } }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...