Submission #574840

#TimeUsernameProblemLanguageResultExecution timeMemory
574840mdubaisiA Difficult(y) Choice (BOI21_books)C++14
0 / 100
10 ms976 KiB
#include <bits/stdc++.h> #include "books.h" #define all(v) (v.begin()), (v.end()) #define setall(a, val) memset(a, val, sizeof a) #define ll long long using namespace std; void solve(int N, int K, ll A, int S) { vector<ll> v(N + 1); for (int i = 1; i <= N; i++) v[i] = skim(i); vector<int> ans; for (int i = N - K + 1; i >= 0; i--) { ll s = 0; ans.clear(); for (int j = i; j < i + K; j++) s += v[j], ans.push_back(j); if (s >= A && s <= 2 * A) { answer(ans); 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...