Submission #713109

#TimeUsernameProblemLanguageResultExecution timeMemory
713109Vu_CG_CoderGap (APIO16_gap)C++14
30 / 100
58 ms2240 KiB
#include <stdio.h> #include <stdlib.h> #include <vector> #include <bits/stdc++.h> #include "gap.h" #define ll long long using namespace std; long long findGap(int t , int n) { long long l = 0 , r = 1e18; vector <long long> kq; for (int i = 1 ; i <= (n + 1)/2 ; i++) { ll s , t; MinMax(l,r,&s,&t); kq.push_back(s); kq.push_back(t); l = (s) + 1; r = (t) - 1; } sort(kq.begin(),kq.end()); long long res = 0; for (int i = 1 ; i < kq.size() ; i++) res = max(res,kq[i] - kq[i - 1]); return res; }

Compilation message (stderr)

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