Submission #480622

#TimeUsernameProblemLanguageResultExecution timeMemory
480622HaidaraDistributing Candies (IOI21_candies)C++17
Compilation error
0 ms0 KiB
#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 vector<int>(a.begin(),a.end()); }

Compilation message (stderr)

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