제출 #981070

#제출 시각아이디문제언어결과실행 시간메모리
981070FZ_Melo추월 (IOI23_overtaking)C++17
0 / 100
2 ms348 KiB
#include "overtaking.h" #include <bits/stdc++.h> using namespace std; int l, n, m; long long t[1001][1001]; long long speed[1000]; long long nspeed; long long pos[1001]; void init(int L, int N, std::vector<long long> T, std::vector<int> W, int X, int M, std::vector<int> S) { n=N; l=L; m=M; for(int i=0; i<n; i++){ t[0][i]=T[i]; speed[i]=W[i]; } nspeed=X; for(int i=0; i<m; i++){ pos[i]=S[i]; } return; } long long arrival_time(long long Y) { t[0][n]=Y; for(int i=1; i<m; i++){ for(int j=0; j<n; j++){ t[i][j]=0; for(int k=0; k<n; k++){ if(t[i-1][j]>t[i-1][k]){ t[i][j]=max(t[i][j], t[i-1][k]+speed[k]*(pos[i]-pos[i-1])); } } t[i][j]=max(t[i][j], t[i-1][j]+speed[j]*(pos[i]-pos[i-1])); t[i][j]=max(t[i][j], t[i-1][n]+nspeed*(pos[i]-pos[i-1])); if(t[i-1][j]<t[i-1][n]) t[i][n]=max(t[i][n], t[i-1][j]+speed[j]*(pos[i]-pos[i-1])); } t[i][n]=max(t[i][n], t[i-1][n]+nspeed*(pos[i]-pos[i-1])); } return t[m-1][n]; }
#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...