제출 #1328295

#제출 시각아이디문제언어결과실행 시간메모리
1328295nguyenkhangninh99Gap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;

#define ll long long

ll findGap(ll t, ll n){
    ll ans = 0;
    if(t == 1){
        vector<ll> a;
        ll l = 1, r = 1e18;
        while(a.size() < n){
            ll mn = 1e18, mx = -1e18;
            MinMax(l, r, &mn, &mx);
            if(mn == -1) break;
            a.push_back(mn);
            a.push_back(mx);
            l = mn + 1;
            r = mx - 1;
        }
        sort(a.begin(), a.end());
        for(int i = 0; i + 1 < a.size(); i++) ans = max(ans, a[i + 1] - a[i]);
    }
    return ans;
}

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

/usr/bin/ld: /tmp/ccqZzgxS.o: in function `main':
grader.cpp:(.text.startup+0x1ee): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status