Submission #1038977

#TimeUsernameProblemLanguageResultExecution timeMemory
1038977ZicrusOvertaking (IOI23_overtaking)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> #include "overtaking.h" using namespace std; typedef long long ll; vector<ll> tCur, tNxt; vector<int> s; int x, m; void init(int l, int n, vector<ll> t, vector<int> w, int x1, int m1, vector<int> s1) { s = s1; m = m1; x = x1; tCur = vector<ll>(m-1); tNxt = vector<ll>(m-1); ll start = t[0], timePerKm = w[0]; for (int t = 0; t < m-1; t++) { ll idealNxt = start + timePerKm * (s[t+1] - s[t]); tCur[t] = start; tNxt[t] = idealNxt; start = idealNxt; } } ll arrival_time(ll y) { for (int t = 0; t < m-1; t++) { ll idealNxt = y + x * (s[t+1] - s[t]); if (tCur[t] < y) idealNxt = max(idealNxt, tNxt[t]); y = idealNxt; } return y; }
#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...