제출 #980913

#제출 시각아이디문제언어결과실행 시간메모리
980913vjudge1추월 (IOI23_overtaking)C++17
컴파일 에러
0 ms0 KiB
// hola soy Dember :D // 31/03/2024 #include <bits/stdc++.h> #include "overtaking.h" #define ll long long #define pll pair<ll,ll> //#define F first //#define S second #define Z size() #define pb push_back #define bp pop_back #define fo(x,y,z) for(ll x=y; x<=z; x++) #define of(x,y,z) for(ll x=y; x>=z; x--) #define all(n) n.begin(), n.end() #define arr(x,y,z) x+y, x+y+z using namespace std; const int MN=1e3+3; ll n, m, xd, zd, ans, l, r; ll a[MN], b[MN][MN], f[MN][MN], g[MN][MN]; vector<ll> t,w,s; void init(int L, int N, vector<ll> T, vector<ll> W, int X, int M, vector<ll> S){ n=N; m=M; t=T, w=W, s=S;w.pb(X); fo(i,0,n-1)a[i]=i, f[i][0]=t[i]; fo(j,1,m-1){ sort(arr(a,0,n), [&] (const int &x, const int &y){ if(f[x][j-1]!=f[y][j-1])return f[x][j-1]<f[y][j-1]; return w[x]<w[y]; }); xd=0; fo(h,0,n-1){ ll i=a[h]; f[i][j]=max(xd, f[i][j-1]+w[i]*(s[j]-s[j-1])); xd=f[i][j]; } } fo(j,1,m-1){ sort(arr(a,0,n), [&] (const int &x, const int &y){ if(f[x][j-1]!=f[y][j-1])return f[x][j-1]<f[y][j-1]; return w[x]<w[y]; }); fo(h,0,n-1){ ll i=a[h]; g[j][h]=f[i][j]; if(h)g[j][h]=max(g[j][h], g[j][h-1]); } fo(i,0,n-1)b[i][j]=a[i]; } return; } long long arrival_time(long long Y) { ans=Y; fo(j,1,m-1){ l=0, r=n-1, zd=-1; while (l <= r) { xd=(l+r)/2; if (ans>f[b[xd][j]][j-1])zd=xd,l=xd+1; else r=xd-1; } xd=ans+w[n]*(s[j]-s[j-1]); if(zd!=-1)xd=max(xd, g[j][zd]); ans=xd; //cout<<ans<<" "; } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

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