Submission #1038969

#TimeUsernameProblemLanguageResultExecution timeMemory
1038969fv3Overtaking (IOI23_overtaking)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #include "overtaking.h" int L, N, M; ll X; vector<ll> T; vector<int> W, S; vector<ll> arrival; void init(int l, int n, vector<ll> t, vector<int> w, int x, int m, vector<int> s) { L = l; N = n; T = t; W = w; X = x; M = m; S = s; arrival = vector<ll>(M); for (int i = 0; i < M; i++) arrival[i] = T[0] + W[0] * S[i]; return; } ll arrival_time(ll Y) { for (int i = 1; i < M; i++) { if (Y + S[i-1] * X >= arrival[i-1] && Y + S[i] * X <= arrival[i]) return arrival[i] + (L - S[i]) * X; } return Y + X * L; }
#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...