Submission #696360

# Submission time Handle Problem Language Result Execution time Memory
696360 2023-02-06T10:10:51 Z yaufung Snowball (JOI21_ho_t2) C++17
0 / 100
1 ms 340 KB
#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 time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -