Submission #569037

#TimeUsernameProblemLanguageResultExecution timeMemory
569037BadPenaltyGap (APIO16_gap)C++14
0 / 100
3097 ms2252 KiB
#include "gap.h" #include "bits/stdc++.h" using namespace std; long long findGap(int T, int N) { vector<long long>ll; long long a = 0,b = 1e18,d; MinMax(a,b,&a,&b); ll.push_back(a); a++; while(ll.size()<N) { b = a+1; MinMax(a,b,&b,&d); if(b!=-1) { a = b; ll.push_back(a); } a++; } long long ans = 0; // for(int i = 0;i<N;i++) // cout<<ll[i]<<' '; // cout<<endl; for(int i = 1;i<N;i++) { ans = max(ans,ll[i]-ll[i-1]); } return ans; }

Compilation message (stderr)

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