Submission #362519

#TimeUsernameProblemLanguageResultExecution timeMemory
362519flappybirdGap (APIO16_gap)C++14
30 / 100
56 ms2464 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define MAX 101010 #define INF 1000000000000000001 #define pb push_back #define all(v) v.begin(), v.end() long long findGap(int T, int N) { if (T == 1) { ll i; ll l, r; l = 0; r = INF; int cnt = 0; vector<ll> arr; while (l <= r && cnt + 1 <= ((N + 1) / 2)) { MinMax(l, r, &l, &r); if (l != -1) arr.pb(l); if (r != -1) arr.pb(r); l++; r--; cnt++; } sort(all(arr)); ll ret = 0; for (i = 0; i < arr.size() - 1; i++) ret = max(ret, arr[i + 1] - arr[i]); return ret; } else { } return 0; }

Compilation message (stderr)

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