Submission #515588

#TimeUsernameProblemLanguageResultExecution timeMemory
515588Aldas25Gap (APIO16_gap)C++14
0 / 100
41 ms1856 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; #define FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr) #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define REP(n) FOR(i, 1, (n)) #define f first #define s second #define pb push_back typedef long long ll; const int MAXN = 100100; const ll INF = 1e18+1; ll a[MAXN]; long long findGap(int T, int n) { int le = 1, ri = n; a[0] = 0, a[n+1] = INF; while (le <= ri) { MinMax(a[le-1]+1, a[ri+1]-1, &a[le], &a[ri]); le++; ri--; } ll ans = 0; FOR(i, 1, n-1) ans = max(ans, a[i+1] - a[i]); return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:7:22: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    7 | #define FOR(i, a, b) for (int i = (a); i <= (b); i++)
      |                      ^~~
gap.cpp:32:5: note: in expansion of macro 'FOR'
   32 |     FOR(i, 1, n-1)
      |     ^~~
gap.cpp:35:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   35 |  return ans;
      |  ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...