답안 #671913

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
671913 2022-12-14T08:46:43 Z moday_morning K개의 묶음 (IZhO14_blocks) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MAXX = 1e18 + 3;

int n, k, dp[100000][100000];
void solve () {
    cin >> n >> k;
    vector <int> a(n + 1);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        fill(dp[i], dp[i] + 200, 1e18);
    }
    dp[0][0] = 0;
    for (int i = 1; i <= n; i++) {
        for (int l = 1; l <= k; l++) {
            int mx = 0;
            for (int j = i; j >= 1 && j >= l; j--) {
                mx = max(mx, a[j]);
                dp[i][l] = min(dp[i][l], dp[j - 1][l - 1] + mx);
            }
        }
    }
    cout << dp[n][k] << "\n";
}

signed main() {
//    usaco("triangles");
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1;
//    cin >> t;
    while (t--) {
        solve();
    }
}

Compilation message

/tmp/ccTNH6QW.o: in function `solve()':
blocks.cpp:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTNH6QW.o
blocks.cpp:(.text+0x10): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a(globals_io.o)
blocks.cpp:(.text+0x28): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccTNH6QW.o
blocks.cpp:(.text+0x37): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTNH6QW.o
blocks.cpp:(.text+0x8b): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTNH6QW.o
blocks.cpp:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a(globals_io.o)
blocks.cpp:(.text+0xdf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTNH6QW.o
blocks.cpp:(.text+0x105): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccTNH6QW.o
blocks.cpp:(.text+0x1bc): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cout' defined in .bss._ZSt4cout section in /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a(globals_io.o)
blocks.cpp:(.text+0x21a): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccTNH6QW.o
blocks.cpp:(.text+0x232): additional relocation overflows omitted from the output
/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status