Submission #848771

#TimeUsernameProblemLanguageResultExecution timeMemory
8487717as__7Overtaking (IOI23_overtaking)C++17
Compilation error
0 ms0 KiB
#include "overtaking.h" #include<bits/stdc++.h> using namespace std; #define all(x) x.begin(),x.end() const int N = 2e5 + 1; #define int long long vector<pair<int, int>>t; vector<int> d; int n, m; void init(int L, int NN, vector<int> T, vector<int>W, int X, int MM, vector<int>s) { n = NN, m = MM; t.resize(n + 1); d.resize(m); for (int i = 0; i < n; i++) { t[i].first = T[i]; } for (int i = 0; i < n; i++) { t[i].second = W[i]; } for (int i = 0; i < m; i++) { d[i] = s[i]; } t[n].second = X; return; } int arrival_time(int x) { t[n].first = x; pair<int, int>p = t[n]; int prv = 0; for (int i = 0; i < m; i++) { sort(all(t)); int mx = 0; for (int j = 0; j <= n; j++) { int x = (d[i] - prv) * t[j].second + t[j].first; mx = max(mx, x); if (p == t[j]) { p = { mx,t[j].second }; } t[j] = { mx,t[j].second }; } prv = d[i]; } return p.first; }

Compilation message (stderr)

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