제출 #483980

#제출 시각아이디문제언어결과실행 시간메모리
483980BERNARB01A Difficult(y) Choice (BOI21_books)C++17
0 / 100
3 ms200 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; const int N = (int) 1e5 + 9; int n, k, s; long long a[N], lo, hi; void solve(int nn, int K, long long A, int S) { lo = A; hi = 2 * A; n = nn; k = K; s = S; for (int i = 0; i < n; i++) { a[i] = skim(i + 1); if (a[i] >= lo) { n = i + 1; break; } } map<long long, int> id; for (int i = 0; i < n; i++) { id[a[i]] = i; } for (int i = 0; i < n; i++) { set<long long> se; for (int j = n - 1; j > i; j--) { long long sum = a[i] - a[j]; auto it = se.lower_bound(lo - sum); if (it == se.end()) { continue; } if (sum + *it <= hi) { answer({i + 1, j + 1, id[*it] + 1}); } se.insert(a[j]); } } 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...