Submission #263721

#TimeUsernameProblemLanguageResultExecution timeMemory
263721T0p_Gap (APIO16_gap)C++14
0 / 100
63 ms4080 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; vector<long long> v; long long findGap(int m, int n) { if(m == 1) { long long s = -1, t = 2e18, mn, mx, ans = 0; while(s <= t) { MinMax(s, t, &mn, &mx); v.push_back(mn); if(mn != mx) v.push_back(mx); s = mn + 1; t = mx - 1; } assert(v.size() == n); sort(v.begin(), v.end()); for(int i=1 ; i<v.size() ; i++) ans = max(ans, v[i] - v[i-1]); return ans; } else { } }

Compilation message (stderr)

In file included from /usr/include/c++/9/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:33,
                 from gap.cpp:1:
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:20:19: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |   assert(v.size() == n);
      |          ~~~~~~~~~^~~~
gap.cpp:22:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |   for(int i=1 ; i<v.size() ; i++)
      |                 ~^~~~~~~~~
gap.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...