제출 #1064179

#제출 시각아이디문제언어결과실행 시간메모리
1064179jer033추월 (IOI23_overtaking)C++17
39 / 100
3520 ms9200 KiB
#include "overtaking.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using tlli = tuple<ll, ll, int>;//prev time, next time, index ll L; int N; vector<ll> T; vector<ll> W; ll X; int M; vector<ll> S; void init(int L1, int N1, std::vector<long long> T1, std::vector<int> W1, int X1, int M1, std::vector<int> S1) { L = L1; N = N1; T = T1; for (int i: W1) W.push_back(i); X = X1; W.push_back(X); M = M1; for (int i: S1) S.push_back(i); } long long arrival_time(long long Y) { T.push_back(Y); vector<vector<ll>> times(N+1); for (int i=0; i<=N; i++) times[i].push_back(T[i]); for (int sorting = 1; sorting<M; sorting++) { ll length = S[sorting] - S[sorting-1]; vector<tlli> move; for (int i=0; i<=N; i++) { move.push_back({times[i][sorting-1], times[i][sorting-1] + (length*W[i]), i}); } sort(move.begin(), move.end()); ll running_max = -1; for (int j=0; j<=N; j++) { running_max = max(running_max, get<1>(move[j])); int i = get<2>(move[j]); times[i].push_back(running_max); } } T.pop_back(); return times[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...