Submission #1008624

#TimeUsernameProblemLanguageResultExecution timeMemory
1008624aaaaaarroz추월 (IOI23_overtaking)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll l,n,x,m; vector<ll>t; vector<ll>w,s; void init(ll L,ll N,vector<ll>T,vector<ll>W,ll X,ll M,vector<ll>S){ l=L; n=N; t=T; w=W; x=X; m=M; s=S; } ll arrival_time(ll arrival){ vector<ll>ex(n+1); vector<pair<ll,ll>>time(n+1); for(ll i=0;i<n;i++){ time[i]={t[i],i}; time[n]={arrival,n}; } for(ll i=1;i<m;i++){ for(ll j=0;j<n;j++){ ex[j]=time[j].first+(w[j]*(s[i]-s[i-1])); } ex[n]=(time[n].first+(x*(s[i]-s[i-1]))); map<ll,vector<ll>>nv; for(ll j=0;j<=n;j++){ nv[time[j].first].push_back(j); } ll mx=0; auto newtime=time; for(auto [key, val]:nv){ for(auto v:val){ newtime[v]={v,max(mx,ex[v])}; } for(auto v:val){ mx=max(mx,ex[v]); } } sort(newtime.begin(),newtime.end()); for(ll j=0;j<=n;j++){ time[j]={newtime[j].second,newtime[j].first}; } } return time[n].first; }

Compilation message (stderr)

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