# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1185820 | LeonidCuk | A Difficult(y) Choice (BOI21_books) | C++20 | 0 ms | 0 KiB |
#include <iostream>
#include <vector>
#include "books.h"
using namespace std;
void solve(int n, int k, long long a, int s)
{
int l=0,r=n-1,bb=0;
vector<int>res;
while(l<r)
{
int m=(l+r)/2;
if(skim(m)>=a)
{
r=m;
}
else
{
l=m+1;
}
}
while(l<n)
{
long long int t=skim(l);
if(t>2*a||t<a){
impossible;
return;
}
else
{
res.push_back(l);
l++;
if(res.size()==k)
{
answer(res);
return;
}
}
}
impossible();
}
int main(){
}