Submission #480619

# Submission time Handle Problem Language Result Execution time Memory
480619 2021-10-17T12:57:00 Z Haidara Distributing Candies (IOI21_candies) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include<candies.h>
#define int long long 
using namespace std;
vector<int> distribute_candies(vector<int> c,vector<int> l,vector<int> r, vector<int> v)
{
	vector<int>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((int)0,a[j]-v[i]);
	return a;
}

Compilation message

/usr/bin/ld: /tmp/ccq77ITt.o: in function `main':
grader.cpp:(.text.startup+0x30e): undefined reference to `distribute_candies(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status