제출 #605077

#제출 시각아이디문제언어결과실행 시간메모리
605077MohamedFaresNebiliAliens (IOI16_aliens)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
/// #pragma GCC optimize ("Ofast")
/// #pragma GCC target ("avx2")
/// #pragma GCC optimize("unroll-loops")

            using namespace std;

            using ll = long long;
            using ld = long double;

            #define ff first
            #define ss second
            #define pb push_back
            #define all(x) (x).begin(), (x).end()
            #define lb lower_bound
            #define int ll

            const int MOD = 998244353;

            int N, M, K, A[1001];
            map<int, int> DP[500];
            ll solve(int i, int t) {
                if(t < 0) return 1000000000LL * 1000000000LL;
                if(i == N) return 0;
                if(DP[i].count(t)) return DP[i][t];
                ll best = 1000000000LL * 1000000000LL;
                for(int l = i; l < N; l++) {
                    ll cur = (A[l] - A[i] + 1); cur *= cur;
                    best = min(best, cur + solve(l + 1, t - 1));
                }
                return DP[i][t] = best;
            }

            long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) {
                M = m, K = k;
                for(auto u : r) {
                    if(N == 0 || A[N - 1] != u)
                        A[N++] = u;
                }
                ll best = solve(0, k);
                return best;
            }

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

/usr/bin/ld: /tmp/cc6WLUTE.o: in function `main':
grader.cpp:(.text.startup+0xf0): undefined reference to `take_photos(int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status