제출 #1032302

#제출 시각아이디문제언어결과실행 시간메모리
1032302Marco_EscandonA Difficult(y) Choice (BOI21_books)C++14
0 / 100
2 ms1112 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; const string ny[2] = {"No", "Yes"}; #include"books.h" void solve(int n, int k, long long a, int S) { ll cad[n+1]; ll v[k+2],ac=0; for(int i=1; i<=n; i++) { cad[i]=skim(i); if(i<k) { v[i]=i; ac+=cad[i]; } } for(int i=k-1; i>-1; i--) { while(v[i]<n&&ac<a&&ac+1<=2*a&&(v[i]<v[i+1]||i==k-1)) { ac-=v[i]; v[i]++; ac+=v[i]; } } if(ac<a) impossible(); vector<int> ans; for(int i=0; i<k; i++) ans.push_back(v[i]); answer(ans); }
#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...