제출 #545203

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