Submission #889154

# Submission time Handle Problem Language Result Execution time Memory
889154 2023-12-19T03:48:09 Z Ghulam_Junaid Roller Coaster Railroad (IOI16_railroad) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

ll plan_roller_coaster (vector<ll> s, vector<ll> t){
    ll n = s.size();
    if (n == 1) return 0;

    vector<ll> all;
    for (ll i=0; i<n; i++)
        all.push_back(i);

    ll output = 2e18;
    do{
        ll val = 0;
        for (ll i=1; i<n; i++){
            val += max(0ll, (ll)(t[i - 1] - s[i])); 
        }
        output = min(output, val);
    } while(next_permutation(all.begin(), all.end()));
    return output;
}

Compilation message

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