Submission #480620

# Submission time Handle Problem Language Result Execution time Memory
480620 2021-10-17T12:58:07 Z Haidara Distributing Candies (IOI21_candies) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include<candies.h>
#define intt long long 
using namespace std;
vector<int> distribute_candies(vector<intt> c,vector<intt> l,vector<intt> r, vector<intt> v)
{
	vector<intt>a((int)c.size(),0);
	for(int i=0;i<(int)l.size();i++)
		for(int j=l[i];j<=r[i];j++)
			if(v[i]>0)
				a[j]=min(a[j]+v[i],c[j]);
			else 
				a[j]=max((intt)0,a[j]-v[i]);
	return a;
}

Compilation message

candies.cpp: In function 'std::vector<int> distribute_candies(std::vector<long long int>, std::vector<long long int>, std::vector<long long int>, std::vector<long long int>)':
candies.cpp:14:9: error: could not convert 'a' from 'vector<long long int>' to 'vector<int>'
   14 |  return a;
      |         ^
      |         |
      |         vector<long long int>