Submission #1091334

#TimeUsernameProblemLanguageResultExecution timeMemory
1091334Trisanu_DasSolar Storm (NOI20_solarstorm)C++17
0 / 100
76 ms13556 KiB
#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 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...