Submission #435873

# Submission time Handle Problem Language Result Execution time Memory
435873 2021-06-23T20:27:25 Z paisie Distributing Candies (IOI21_candies) C++17
0 / 100
136 ms 8800 KB
#include<bits/stdc++.h>
using namespace std;
#define pb push_back

#define ll long long
vector<int> distribute_candies(vector <int> c, vector<int> l, vector <int>r, vector<int> v){
	int n = c.size();
	int q = l.size();
	
	vector <ll> pre(n+1, 0);
	vector <int> ans(n, 0);
	
	for(int i=0; i<q; i++){
		pre[l[i]]+=v[i];
		pre[r[i]+1]-=v[i];
	}
	
	ans[0] = pre[0];
	
	for(int i=1; i<n; i++){
		ans[i] = min(ans[i-1]+pre[i], 1LL*c[i]);
	}
	
	return ans;
 }



# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 136 ms 8800 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -