# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
863480 | HossamHero7 | A Difficult(y) Choice (BOI21_books) | C++14 | 102 ms | 1236 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"
//#include "grader.cpp"
using namespace std;
typedef long long ll;
void solve(int n, int k, long long a, int s) {
vector<ll> v(n);
for(int i=0;i<n;i++) v[i] = skim(i+1);
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
int idx = lower_bound(v.begin()+j+1,v.end(),a-v[i]-v[j]) - v.begin();
if(idx == v.size()) continue;
if(a <= v[i] + v[j] + v[idx] && v[i] + v[j] + v[idx] <= 2*a) return answer({i+1,j+1,idx+1});
}
}
impossible();
}
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... |