Submission #696360

#TimeUsernameProblemLanguageResultExecution timeMemory
696360yaufungSnowball (JOI21_ho_t2)C++17
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> using namespace std; #define LL long long int main() { ios::sync_with_stdio(false), cin.tie(0); int n, q; cin >> n >> q; vector<LL> a(n + 5), Q(q + 5); for (int i = 1; i <= n; i++) { cin >> a[i]; } for (int i = 1; i <= q; i++) { cin >> Q[i]; } vector<LL> l(q + 5), r(q + 5); LL p = 0; l[0] = r[0] = 0; for (int i = 1; i <= q; i++) { p += Q[i]; r[i] = max(r[i - 1], -p); l[i] = max(l[i - 1], p); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...