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;
int flag=1;
for(int i=14; i>=0&&flag; i--)
{
int tmp=s+(1<<i);
if(tmp<=N-K+1)
{
long long sum=0;
for(int l=tmp; l<tmp+K; l++)
{
sum+=skim(l);
}
if(sum<=(2LL*A)) s=tmp;
if(sum<=2*A&&sum>=A) flag=0;
}
}
long long sum=0;
if(s>=N-K+2) 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... |