# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
657603 | TimDee | A Difficult(y) Choice (BOI21_books) | C++17 | 11 ms | 208 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"books.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(int n, int k, ll A, int s) {
if (s!=n) return;
vector<ll> a(n);
for (int i=0; i<n; ++i) a[i]=skim(i+1);
if (k==3) {
for (int i=0; i<n; ++i) {
for (int j=i+1; j<n-1; ++j) {
int l=j+1, r=n-1;
ll sum1 = a[i]+a[j];
while (l<r) {
int mid=(l+r)>>1;
if (sum1+a[mid]<A) l=mid+1;
else r=mid;
}
ll sum=sum+a[r];
if ((sum>=A) && (sum<=2*A)) {
answer({i+1,j+1,r+1});
return;
}
}
}
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... |