제출 #931141

#제출 시각아이디문제언어결과실행 시간메모리
931141Amirreza_FakhriGap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
// In the name of the God #include "gap.h" #include <bits/stdc++.h> #define ll long long // #define int long long #define pb push_back #define F first #define S second #define mp make_pair #define pii pair <int, int> #define smin(x, y) (x) = min((x), (y)) #define smax(x, y) (x) = max((x), (y)) #define all(x) (x).begin(), (x).end() using namespace std; const int inf = 1e9+7; const int mod = 998244353; const ll maxn = 1e18; ll a[100005]; ll findGap(int t, int n) { if (t == 1) { ll s = 1, e = maxn; for (ll i = 0; i < (n + 1) / 2; i++) { ll mn, mx; MinMax(s, e, &mn, &mx); a[j++] = mn; a[j++] = mx; s = mn + 1, e = mx - 1; } ll ans = 0; for (ll i = 2; i <= n; i++) smax(ans, a[i] - a[i-1]); return ans; } return 1ll; } // int32_t main() { // ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // return 0; // }

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:30:15: error: 'j' was not declared in this scope
   30 |             a[j++] = mn;
      |               ^