Submission #435850

# Submission time Handle Problem Language Result Execution time Memory
435850 2021-06-23T19:35:36 Z paisie Distributing Candies (IOI21_candies) C++17
0 / 100
127 ms 8400 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define forr(X) for(int i = 0; i<X; i++)
#pragma GCC optimize("Ofast")



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 <int> pre(n+1, 0), ans;
	
	forr(q){
		pre[l[i]]+=v[i];
		pre[r[i]+1]-=v[i];
	}
	

	forr(n){
		if(i>0)pre[i]+=pre[i-1];
		
		ans.pb( min(c[i], pre[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 127 ms 8400 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 -