Submission #1241451

#TimeUsernameProblemLanguageResultExecution timeMemory
1241451SalihSahinOvertaking (IOI23_overtaking)C++20
0 / 100
4 ms8260 KiB
#include "bits/stdc++.h" #include "overtaking.h" #define pb push_back using namespace std; const int MAXN = 1e3 + 5; vector<vector<long long> > t(MAXN, vector<long long>(MAXN)); vector<int> ST, w; int n, m, x; void init(int L, int N, vector<long long> T, vector<int> W, int X, int M, vector<int> S){ for(int i = 0; i < N; i++){ t[i][0] = T[i]; } for(int j = 1; j < M; j++){ vector<long long> ep(N); for(int i = 0; i < N; i++){ ep[i] = t[i][j-1] + W[i] * (S[j] - S[j-1]); } for(int i = 0; i < N; i++){ long long mval = ep[i]; for(int cek = 0; cek < N; cek++){ if(t[cek][j-1] < t[i][j-1]){ mval = max(mval, ep[cek]); } } t[i][j] = mval; } } ST = S; n = N; m = M; x = X; w = W; } long long arrival_time(long long Y){ vector<long long> myt(m); myt[0] = Y; for(int j = 1; j < m; j++){ vector<long long> ep(n); for(int i = 0; i < n; i++){ ep[i] = t[i][j-1] + w[i] * (ST[j] - ST[j-1]); } long long mval = myt[j-1] + x * (ST[j] - ST[j-1]); for(int cek = 0; cek < n; cek++){ if(t[cek][j-1] < myt[j-1]){ mval = max(mval, ep[cek]); } } myt[j] = mval; } return myt[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...