Submission #708798

#TimeUsernameProblemLanguageResultExecution timeMemory
708798KiprasA Difficult(y) Choice (BOI21_books)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

#include "books.h"

typedef long long ll;

using namespace std;

void solve(ll n, ll k, ll c, ll s){


    vector<ll> a;
    a.push_back(0);

    for(int i = 0; i < n; i++){
        a.push_back(skim(i+1));
    }

    vector<ll> pref;
    pref.push_back(0);

    for(int i = 1; i <= n; i++){
        pref[i]=pref[i-1]+a[i];
    }

    for(int i = 0; i <= n-k; i++){
        if(pref[i+k]-pref[i]>=c&&pref[i+k]-pref[i]<=2*c){
            vector<int> aa;
            for(int x = i+1; x <= i+k; x++){
                aa.push_back(x);
            }
            answer(aa);
            return;
        }
    }

    impossible();

}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccBPjxfl.o: in function `main':
grader.cpp:(.text.startup+0x83): undefined reference to `solve(int, int, long long, int)'
collect2: error: ld returned 1 exit status