Submission #667327

#TimeUsernameProblemLanguageResultExecution timeMemory
667327MahdiGap (APIO16_gap)C++17
0 / 100
49 ms2324 KiB
#include<bits/stdc++.h> #include "gap.h" using namespace std; #define all(v) v.begin(), v.end() typedef long long ll; long long findGap(int T, int N){ if(T==1){ vector<ll>v; ll a=-1, b=1e18+1, c, d; for(int i=0;i<N;i+=2){ MinMax(a+1, b-1, &c, &d); v.push_back(c); v.push_back(d); a=c; b=d; } sort(all(v)); ll ans=0; for(int i=1;i<v.size();++i) ans=max(ans, v[i]-v[i-1]); return ans; } return 0; }

Compilation message (stderr)

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