Submission #142717

#TimeUsernameProblemLanguageResultExecution timeMemory
142717HellAngelGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int T, int N) { long long ans = 0; if(T == 1) { long long mx, my; vector<long long> vt = {}; long long l = 0; long long r = 1e18; while(true) { MinMax(l, r, &mx, &my); if(mx == my) { vt.push_back(mx); break; } if(mx == -1) { break; } vt.push_back(mx); vt.push_back(my); l = mx + 1; r = my - 1; } sort(vt.begin(), vt.end()); for(int i = 1; i < n; i++) { ans = max(ans, vt[i] - vt[i - 1]); } } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:33:28: error: 'n' was not declared in this scope
         for(int i = 1; i < n; i++)
                            ^