Submission #1119181

#TimeUsernameProblemLanguageResultExecution timeMemory
1119181blackslexOvertaking (IOI23_overtaking)C++17
0 / 100
4 ms548 KiB
#include "overtaking.h" #include<bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; int l, n, m, x; vector<int> w, s; vector<ll> t; vector<vector<int>> e, ct; void init(int L, int N, std::vector<long long> T, std::vector<int> W, int X, int M, std::vector<int> S){ l = L; n = N; t = T; w = W; x = X; m = M; s = S; return; } long long arrival_time(long long Y){ e = vector<vector<int>>(n + 1, vector<int>(m)); ct = vector<vector<int>>(n + 1, vector<int>(m)); for (int i = 0; i < n; i++) ct[i][0] = t[i]; ct[n][0] = Y; for (int j = 1; j < m; j++) { map<int, vector<int>> mp; int cmx = 0; for (int i = 0; i < n; i++) { e[i][j] = ct[i][j - 1] + w[i] * (s[j] - s[j - 1]); mp[ct[i][j - 1]].emplace_back(i); } e[n][j] = ct[n][j - 1] + x * (s[j] - s[j - 1]); mp[ct[n][j - 1]].emplace_back(n); for (auto &[x, y]: mp) { for (auto &E: y) ct[E][j] = max(e[E][j], cmx); for (auto &E: y) cmx = max(cmx, e[E][j]); } } return ct[n][m - 1]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...