Submission #48480

#TimeUsernameProblemLanguageResultExecution timeMemory
48480faishol27Gap (APIO16_gap)C++14
30 / 100
64 ms2664 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define PUB push_back vector<ll>data; ll kiri=0, kanan=1e18, rKiri, rKanan; long long findGap(int T, int N) { ll ans = 0; while(data.size() < N){ MinMax(kiri, kanan, &rKiri, &rKanan); kiri = rKiri+1; kanan = rKanan-1; data.PUB(rKiri); if(rKiri != rKanan) data.PUB(rKanan); } sort(data.begin(), data.end()); for(int i=1;i<N;i++){ ans = max(ans, data[i]-data[i-1]); } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:16:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while(data.size() < N){
        ~~~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...