Submission #610553

#TimeUsernameProblemLanguageResultExecution timeMemory
610553nekiRobots (IOI13_robots)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define vc vector using namespace std; int putaway(int A,int B,int T, int X[], int Y[],int W[],int S[]){ int l=1, r=T+1; vc<int> ind(T);for(int i=0;i<T;++i) ind[i]=i; sort(ind.begin(), ind.end(), [&](int a, int b){return W[a]<W[b];}); sort(X, X+A); function<bool (int)> check=[&](int k){ map<int, int> prosti; for(int i=0;i<B;++i) prosti[Y[i]]+=k; int j=A-1; for(int i=T-1;i>=0;--i){ while(j>=0 and X[j]>W[ind[i]]) prosti[INT_MAX]+=k, --j; auto poi=prosti.upper_bound(S[ind[i]]); if(poi==prosti.end()) return false; if(--poi->second ==0) prosti.erase(poi); } return true; }; if(check(T)){ while(l<r){ int mid=(l+r)/2; if(check(mid)) r=mid; else l=mid+1; } return l; } else return -1; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccjKKNx8.o: in function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status