제출 #1074657

#제출 시각아이디문제언어결과실행 시간메모리
1074657Unforgettablepl추월 (IOI23_overtaking)C++17
39 / 100
3568 ms8364 KiB
#include "overtaking.h" #include <bits/stdc++.h> using namespace std; namespace { int L,N,X,M; vector<long long> T,W,S; } 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; for(int&i:W)::W.emplace_back(i); ::X = X; ::M = M; for(int&i:S)::S.emplace_back(i); } 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...