# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
697768 | Sandarach151 | A Difficult(y) Choice (BOI21_books) | C++17 | 210 ms | 1056 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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.
//
void solve(int n, int k, long long a, int s) {
long long arr[n];
vector<int> ans;
for(int i=0; i<n; i++){
arr[i] = skim(i+1);
}
long long cur = 0;
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
for(int k=j+1; k<n; k++){
if(a<=(arr[i]+arr[j]+arr[k]) && (arr[i]+arr[j]+arr[k])<=2*a){
ans.push_back(i+1);
ans.push_back(j+1);
ans.push_back(k+1);
answer(ans);
return;
}
}
}
}
//for(int i=0; i<k; i++){
//cur+=arr[i];
//}
//for(int i=0; i<=n-k; i++){
//if(a<=cur && cur<=2*a){
//for(int j=i; j<i+k; j++){
//ans.push_back(i+1);
//}
//answer(ans);
//return;
//}
//if(i!=n-k){
//cur-=arr[i];
//cur+=arr[i+k];
//}
//}
impossible();
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |