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 ;
const int N = 1e5+5 ;
int a[N] ;
void solve(int n, int k, long long l, int s) {
int sum = 0 ;
for ( int i = 1 ; i <= k ; i++ ) {
sum += a[i] ;
a[i] = skim(i) ;
}
if ( sum > 2*l ) {
impossible () ;
}
int id = k ;
while ( sum < l && id < n ) {
id++ ;
a[id] = skim(id) ;
sum += a[id] ;
sum -= a[id-k] ;
if ( sum > 2*l ) {
impossible () ;
}
}
if ( sum < l ) {
impossible () ;
}
vector <int> v ;
for ( int i = id-k+1 ; i <= id ; i++ ) {
v.push_back(i) ;
}
answer(v) ;
}
# | 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... |