This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
using namespace std;
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <utility>
#include <memory.h>
#include <map>
#include <set>
typedef long long LL;
typedef pair<int,int> pii;
#define pb push_back
#define mkp make_pair
#define iter(x) x.begin(),x.end()
const int maxn = 0;
#include "books.h"
#define mid (LB + RB)/2
void solve(int n,int k,LL a,int s){
LL v[1010];
for (int i=1;i<=n;++i) v[i] = skim(i);
for (int j=2;j<n;++j){
for (int i=1;i<j;++i){
if (v[i] + v[j] >= a*2) break;
int k = lower_bound(v+j+1,v+n+1,a - v[i] - v[j]) - v;
if (k == n+1) continue;
int sum = v[i] + v[j] + v[k];
if (sum <= a*2 and sum >= a) {answer({i,j,k}); return;}
}
}
impossible();
}
# | 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... |