This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int n, s, k; cin >> n >> s >> k;
int d[n - 1], v[n];
for(int i = 0; i < n - 1; i++) cin >> d[i];
for(int i = 0; i < n; i++) cin >> v[i];
cout << "1\n";
if(2 * k + 1 > n) cout << k + 1 << '\n';
else {
int ans_s = 0, ans_i = k + 1;
for(int i = 0; i < 2 * k + 1; i++) ans_s += v[i];
int curr_s = ans_s, curr_i = k + 1;
for(int i = 2 * k + 1; i < n; i++){
curr_i++;
curr_s += v[i] - v[i - 2 * k - 1];
if(curr_s > ans_s){
ans_s = curr_s;
ans_i = curr_i;
}
}
cout << ans_i << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |