답안 #152022

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
152022 2019-09-06T02:12:38 Z EntityIT Homecoming (BOI18_homecoming) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include<homecoming.h>

using namespace std;

using ll = long long;

ll solve(int n, int K, vector<int> a, vector<int> b) {
    ll ret = 0;
    vector<ll> prefB;
    for (int i = 0; i < (n << 1); ++i) prefB.push_back( (i ? prefB[i - 1] : 0) + (b[i % n]) );
    for (int i = 0; i < n; ++i) {
        ret += max( (ll)0, a[i] - prefB[i + K - 1] + (i ? prefB[i - 1] : 0) );
    }
    return ret;
}

Compilation message

/tmp/ccIZH13n.o: In function `main':
grader.cpp:(.text.startup+0xff): undefined reference to `solve(int, int, int*, int*)'
collect2: error: ld returned 1 exit status