답안 #931133

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
931133 2024-02-21T09:53:51 Z Amirreza_Fakhri Gap (APIO16_gap) C++17
컴파일 오류
0 ms 0 KB
// 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 int maxn = 1e18;

ll a[100005];

ll findGap(ll t, ll n) {
    if (t == 1) {
        ll l = 1, r = n, s = 1, e = maxn;
        for (; l <= r; l++, r--) {
            ll mn, mx; MinMax(s, e, &mn, &mx);
            a[l] = mn, a[r] = mx;
            s = mn+1, r = 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;
// }











Compilation message

gap.cpp:20:18: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   20 | const int maxn = 1e18;
      |                  ^~~~
/usr/bin/ld: /tmp/ccVpsFUF.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status