제출 #751178

#제출 시각아이디문제언어결과실행 시간메모리
751178sofija6Gap (APIO16_gap)C++14
30 / 100
49 ms2256 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; long long findGap(int T, int N) { if (T==1) { long long l=0,r=1e18,ans=-1; vector<long long> a; while (true) { if (l>r || a.size()==N) break; long long curl,curr; MinMax(l,r,&curl,&curr); if (curl==-1) break; a.push_back(curl); if (curr!=curl) a.push_back(curr); l=curl+1; r=curr-1; } sort(a.begin(),a.end()); for (long long i=1;i<a.size();i++) ans=max(ans,a[i]-a[i-1]); return ans; } }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:14:32: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |             if (l>r || a.size()==N)
      |                        ~~~~~~~~^~~
gap.cpp:27:29: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |         for (long long i=1;i<a.size();i++)
      |                            ~^~~~~~~~~
gap.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...