Submission #942869

#TimeUsernameProblemLanguageResultExecution timeMemory
942869beepbeepsheepA Difficult(y) Choice (BOI21_books)C++17
0 / 100
5 ms1216 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; // // --- Sample implementation for the task books --- // // To compile this program with the sample grader, place: // books.h books_sample.cpp sample_grader.cpp // in a single folder and run: // g++ books_sample.cpp sample_grader.cpp // in this folder. // #define ll long long void solve(int N, int K, long long A, int S) { // TODO implement this function ll s=1,e=N; ll arr[N+5]; for (int i=s;i<=e;i++){ arr[i]=skim(i); } if (e-s+1<K){ impossible(); return; } vector<int> v; for (int i=s;i<=e-K+1;i++){ ll tot=0; for (int j=i;j<=i+K-1;j++){ v.emplace_back(j); tot+=arr[j]; } //cerr<<endl<<i<<' '<<i+K-1<<' '<<tot<<endl; if (tot>=A && tot<=2*A){ answer(v); return; } v.clear(); } 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...