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;
void solve(int N, int K, long long A, int S)
{
if(S>=170)
{
int s=-1;
for(int i=14; i>=0; i--)
{
int tmp=s+(1<<i);
if(tmp<=N-K)
{
long long sum=0;
for(int l=tmp; l<tmp+K; l++)
{
sum+=skim(l);
}
if(sum<A) s=tmp;
}
}
s++;
long long sum=0;
if(s>N-K) impossible();
vector<int> v;
for(int i=s; i<s+K; i++)
{
v.push_back(i);
sum+=skim(i);
}
if(sum<=2*A)
{
answer(v);
}
else impossible();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |