Submission #657599

#TimeUsernameProblemLanguageResultExecution timeMemory
657599TimDeeA Difficult(y) Choice (BOI21_books)C++17
0 / 100
11 ms208 KiB
#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; ++j) { int l=j+1, r=n; while (l<r) { int mid=(l+r)>>1; if (1ll*a[i]+1ll*a[j]+1ll*a[mid]<A) l=mid+1; else r=mid; } if (1LL*a[i]+1LL*a[j]+1LL*a[r]<=2*A) { answer({i+1,j+1,r+1}); return; } } } impossible(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...