# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
708796 | Kipras | A Difficult(y) Choice (BOI21_books) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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<ll> aa;
for(int x = i+1; x <= i+k; x++){
aa.push_back(x);
}
answer(aa);
return;
}
}
impossible();
}