Submission #490830

# Submission time Handle Problem Language Result Execution time Memory
490830 2021-11-29T13:04:09 Z Karuk Distributing Candies (IOI21_candies) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
vector<int> 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]);
        }
    }
    vector<int>anss;
    for(int i:ans)anss.push_back(i);
    return anss;
}

Compilation message

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