Submission #648581

#TimeUsernameProblemLanguageResultExecution timeMemory
648581berrA 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; int flag=1; for(int i=14; i>=0&&flag; i--) { int tmp=s+(1<<i); if(tmp<=N-K+1) { long long sum=0; for(int l=tmp; l<tmp+K; l++) { sum+=skim(l); } if(sum<=(2LL*A)) s=tmp; if(sum<=2*A&&sum>=A) flag=0; } } long long sum=0; if(s>=N-K+2) 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...