Submission #446863

#TimeUsernameProblemLanguageResultExecution timeMemory
446863wiwihoA Difficult(y) Choice (BOI21_books)C++14
0 / 100
12 ms328 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; typedef long long ll; void ans(int st, int k){ vector<int> v(k); for(int i = 0; i < k; i++) v[i] = st + i; answer(v); } void solve(int n, int k, ll A, int S){ assert(n == S); vector<ll> x(n + 1); for(int i = 1; i <= n; i++){ x[i] = skim(i); } ll sum = 0; for(int i = 1; i <= k; i++) sum += x[i]; if(sum > 2 * A) impossible(); if(sum >= A) ans(1, k); for(int i = k + 1; i <= n; i++){ sum -= x[i - k]; sum += x[i]; if(sum > 2 * A) impossible(); if(sum >= A) ans(i - k + 1, k); } impossible(); }
#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...