Submission #1011305

#TimeUsernameProblemLanguageResultExecution timeMemory
1011305overwatch9A Difficult(y) Choice (BOI21_books)C++17
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; using ll = long long; // // --- Sample implementation for the task books --- // // To compile this program with the sample grader, place: // books.h books_sample.cpp sample_grader.cpp // in a single folder and run: // g++ books_sample.cpp sample_grader.cpp // in this folder. // // vector <int> NUMS; // ll skim(int x) { // return NUMS[x]; // } void solve(int N, int K, ll A, int S) { int lo = 1, hi = N; int r = -1; while (lo <= hi) { int mid = (lo + hi) / 2; int x = skim(mid); if (x >= A) { hi = mid-1; } else { lo = mid+1; r = mid; } } if (r == -1) impossible(); else { vector <int> ans(K); for (int i = r - K + 1; i <= r; i++) ans[i - (r - K + 1)] = i; answer(ans); } } // int main() { // int n, k, a, s; // cin >> n >> k >> a >> s; // NUMS.resize(n+1); // for (int i = 1; i <= n; i++) // cin >> NUMS[i]; // solve(n, k, a, s); // }
#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...