Submission #1074656

#TimeUsernameProblemLanguageResultExecution timeMemory
1074656UnforgettableplOvertaking (IOI23_overtaking)C++17
0 / 100
3 ms604 KiB
#include "overtaking.h" #include <bits/stdc++.h> using namespace std; namespace { int L,N,X,M; vector<int> W,S; vector<long long> T; } void init(int L,int N,vector<long long> T,vector<int> W,int X,int M,vector<int> S){ W.emplace_back(X); ::L = L; ::N = N; ::T = T; ::W = W; ::X = X; ::M = M; ::S = S; } long long arrival_time(long long Y){ vector e(N+1,vector<long long>(M)); for(int i=0;i<N;i++)e[i][0]=T[i]; e[N][0]=Y; for(int j=1;j<M;j++) { for(int i=0;i<=N;i++) { e[i][j]=e[i][j-1]+W[i]*(S[j]-S[j-1]); } for(int i=0;i<=N;i++) { for(int k=0;k<=N;k++) { if(e[k][j-1]<e[i][j-1])e[i][j]=max(e[i][j],e[k][j]); } } } return e[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...