제출 #109433

#제출 시각아이디문제언어결과실행 시간메모리
109433PlurmGap (APIO16_gap)C++11
30 / 100
134 ms8640 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int T, int N) { if(T == 1){ long long lo = 0ll; long long hi = 1e18; long long mn, mx; set<long long> s; do{ MinMax(lo, hi, &mn, &mx); if(mn == -1) break; s.insert(mn); s.insert(mx); lo = mn + 1; hi = mx - 1; }while(lo <= hi && s.size() < N); vector<long long> v; for(long long x : s) v.push_back(x); mx = 0ll; for(int i = 1; i < N; i++){ mx = max(mx, v[i] - v[i-1]); } return mx; } return 0; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:19:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         }while(lo <= hi && s.size() < N);
                            ~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...