Submission #729115

#TimeUsernameProblemLanguageResultExecution timeMemory
729115Jean7A Difficult(y) Choice (BOI21_books)C++14
0 / 100
2 ms208 KiB
#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++ ) { a[i] = skim(i) ; sum += a[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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...