제출 #712697

#제출 시각아이디문제언어결과실행 시간메모리
712697dungnguyenn_05Gap (APIO16_gap)C++17
0 / 100
57 ms2644 KiB
#include<bits/stdc++.h> #include "gap.h" #define pb push_back #define all(x) x.begin(),x.end() using namespace std; typedef long long ll; vector<ll> pre,suf; long long findGap(int T, int N) { long long s=0,t=1e18; ll mn,mx; while(s<t) { MinMax(s,t,&mn,&mx); if(mn==-1) break; pre.pb(mn); suf.pb(mx); s=mn+1; t=mx-1; } reverse(all(suf)); for(ll x:suf) pre.pb(x); for(int x:pre) cout<<x<<' '; cout<<endl; ll res=0; for(int i=1;i<pre.size();i++) res=max(res,pre[i]-pre[i-1]); return res; }

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

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