제출 #1066976

#제출 시각아이디문제언어결과실행 시간메모리
1066976duckindogA Difficult(y) Choice (BOI21_books)C++17
5 / 100
10 ms344 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; void solve(int n, int k, long long a, int s) { if (s == n && k == 3) { vector<long long> x(n + 1); for (int i = 1; i <= n; ++i) x[i] = skim(i); for (int i = 1; i < n; ++i) { for (int j = i + 1; j <= n; ++j) { if (x[i] + x[j] > 2 * a) break; int t = lower_bound(x.begin() + 1, x.end(), a - x[i] - x[j]) - x.begin(); for (; t <= n; ++t) { if (t == i || t == j) continue; long long value = x[i] + x[j] + x[t]; if (x[i] + x[j] + x[t] > 2 * a) break; if (a <= value) { answer(vector<int>{i, j, t}); 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...