| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1365000 | lucasdmy | A Difficult(y) Choice (BOI21_books) | C++20 | 1 ms | 812 KiB |
#include <bits/stdc++.h>
#include "books.h"
using namespace std;
void solve(int n, int books, long long int a, int s){
vector<int>v(n);
for(int k=1;k<=n;k++){
v[k-1]=skim(k);
}
for(int k=0;k<n-1;k++){
for(int i=k+1;i<n;i++){
int aux=lower_bound(v.begin(), v.end(), 2*a-v[k]-v[i])-v.begin();
if(aux<=i){
continue;
}
if(aux==n){
if(i==n-1){
continue;
}
if(v[k]+v[i]+v[n-1]<a){
continue;
}
answer({k, i, n-1});
}
if(v[aux]+v[k]+v[i]==2*a){
answer({k, i, aux});
}
if(aux!=i+1 and v[aux-1]+v[k]+v[i]>a){
answer({k, i, aux-1});
}
}
}
impossible();
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
