# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
772798 | Imeon | 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"
using namespace std;
def Solve(int N, int K, int S, long long A) {
int N, K, S , A;
cin >> N >> K >> S >> A;
vector<int>pref;
vector<int>suff;
vector<int>x;
long long x[N + 1];
long long sm = 0;
int f = 0;
for (int i = 1; i <= S + 1;i++){
x[i] = skim(i);
sm += x[i];
f++;
if (f > K){sm -= x[i - k - 1];}
if (sm >= A and sm <= 2ll * A){
vector<int>v;
for (int j = i - k; j <= i; j++){
v.push_back(j);
}
answer(v);
}
}
imposibble()
}