Submission #1067169

#TimeUsernameProblemLanguageResultExecution timeMemory
1067169duckindogA Difficult(y) Choice (BOI21_books)C++17
20 / 100
168 ms1112 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 + 1); for (int i = 1; i <= n; ++i) x[i] = skim(i); auto d = x; for (int i = 1; i <= n; ++i) d[i] += d[i - 1]; vector<int> ret; for (int i = k; i <= n; ++i) { if (a <= d[i] - d[i - k] && d[i] - d[i - k] <= a * 2) { for (int j = i - k + 1; j <= i; ++j) ret.push_back(j); answer(ret); return; } } for (int i = k; i <= n; ++i) { if (a <= d[k - 1] + x[i] && d[k - 1] + x[i] <= 2 * a) { for (int j = 1; j < k; ++j) ret.push_back(j); ret.push_back(i); answer(ret); 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...