Submission #810707

#TimeUsernameProblemLanguageResultExecution timeMemory
810707MyCodeA Difficult(y) Choice (BOI21_books)C++17
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; void solve(int n, int k, long long A, int S) { int l = 1, r = n - k + 1; while (r - l > 1) { int m = (l + r) / 2; if (skim(m + k - 1) >= A) r = m; else l = m; } int ind = -1; if (skim(l + k - 1) >= A) { ind = l; } else if (skim(r + k - 1) >= A) { ind = r; } if (ind != -1) { vector<int> ans; for (int i = ind; i < ind + k; i++) ans.emplace_back(i); answer(ans); } else { 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...