제출 #629645

#제출 시각아이디문제언어결과실행 시간메모리
629645Cyber_WolfGap (APIO16_gap)C++14
0 / 100
23 ms1172 KiB
//Contest: APIO 16 Problem 3 //Problem Name: Gap #include <bits/stdc++.h> #include "gap.h" using namespace std; #define lg long long long long findGap(int subtask, int n) { vector<long long> v; long long first = 0, last = 1e18; while(v.size() < n) { long long mnm, mxm; MinMax(first, last, &mnm, &mxm); v.push_back(mnm); if(mnm != mxm) v.push_back(mxm); last = mnm+1; first = mxm-1; } long long ans = 0; sort(v.begin(), v.end()); for(int i = 1; i < v.size(); i++) ans = max(ans, v[i]-v[i-1]); return ans; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:16:17: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   16 |  while(v.size() < n)
      |        ~~~~~~~~~^~~
gap.cpp:27:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |  for(int i = 1; i < v.size(); i++) ans = max(ans, v[i]-v[i-1]);
      |                 ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...