Submission #1327082

#TimeUsernameProblemLanguageResultExecution timeMemory
1327082antarbanikRace (IOI11_race)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define yes cout << "YES\n";
#define nl cout << endl;
#define no cout << "NO\n";
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define pb push_back
#define ppb pop_back
// #define mp make_pair
#define ff first
#define ss second
#define st string





int best_path(int n, int k, vector<vector<int>> H, vector<int> L){

    int ans = INT_MAX;

    int m = L.size();
    for(int i = 0;i<m;++i){
        int s = 0;
        for(int j = i;j<m;++j){
            s += L[j];
            if(s == k){
                ans = min(ans, j - i + 1);
            }
        }
    }

    if(ans == INT_MAX) ans = -1;
    return ans;
}




// int main(){


//     cout<<best_path(5, 10, {{0,1},{1,2},{2,3},{3,4}}, {3, 2, 5, 1});

// }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccBxXYwX.o: in function `main':
grader.cpp:(.text.startup+0x28): undefined reference to `best_path(int, int, int (*) [2], int*)'
collect2: error: ld returned 1 exit status