| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1365009 | lucasdmy | A Difficult(y) Choice (BOI21_books) | C++20 | 1089 ms | 1204 KiB |
#include <bits/stdc++.h>
#include "books.h"
using namespace std;
void solve(int n, int books, long long int a, int s){
vector<long long int>v(n);
for(int k=1;k<=n;k++){
v[k-1]=skim(k);
}
for(int k=0;k<n;k++){
int p1=0, p2=n-1;
long long int low_sum=a-v[k], big_sum=2*a-v[k];
while(p1<p2){
if(p1==k){
p1++;
}
if(p2==k){
p2--;
}
if(v[p1]+v[p2]>big_sum){
p2--;
continue;
}
if(v[p1]+v[p2]<low_sum){
continue;
}
vector<int>resp={k+1, p1+1, p2+1};
answer(resp);
}
}
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... | ||||
