Submission #648050

#TimeUsernameProblemLanguageResultExecution timeMemory
648050berrA Difficult(y) Choice (BOI21_books)C++17
0 / 100
3 ms292 KiB
#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; for(int i=14; i>=0; i--) { int tmp=s+(1<<i); if(tmp<=N-K) { long long sum=0; for(int l=tmp; l<tmp+K; l++) { sum+=skim(l); } if(sum<A) s=tmp; } } s++; long long sum=0; if(s>N-K) 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 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...