Submission #490829

# Submission time Handle Problem Language Result Execution time Memory
490829 2021-11-29T13:03:11 Z Karuk Distributing Candies (IOI21_candies) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
vector<long long> distribute_candies(vector<long long> c, vector<long long> l, vector<long long> r, vector<long long> v)
{
    long long n=sizeof(c);
    long long q=sizeof(l);
    vector<long long>ans(n,0);
    for(long long i=0;i<q;i++)
    {
        for(long long j=l[i];j<=r[i];j++)
        {
            if(v[i]>0)ans[j]=min(c[j],ans[j]+v[i]);
            else ans[j]=max((long long) 0,ans[j]+v[i]);
        }
    }
    return ans;
}

Compilation message

/usr/bin/ld: /tmp/ccNZ3YDQ.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