제출 #629897

#제출 시각아이디문제언어결과실행 시간메모리
629897hy_1Gap (APIO16_gap)C++14
0 / 100
24 ms1872 KiB
#include "gap.h" #include <bits/stdc++.h> #define ll long long using namespace std; long long findGap(int T, int N){ ll n = N; vector<ll> arr(n); ll l =1 , r = 1e18; while(arr.size() < n){ ll mn , mx; MinMax(l , r , &mn , &mx); arr.push_back(mn); if(mn != mx){ arr.push_back(mx); } l += 1; r -= 1; } ll ans = 0; sort(arr.begin() , arr.end()); for(int i =1; i<n; i++){ ll y = arr[i] - arr[i-1]; // ans = max(ans , y); if(y > ans) ans = y; } return ans; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:13:19: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   13 |  while(arr.size() < n){
      |        ~~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...