This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
{
if (X >= W[0] || Y <= T[0] || Y + X * L >= arrival.back())
return Y + X * L;
for (int i = 1; i < M; i++)
{
if (Y + S[i] * X <= arrival[i])
return arrival[i] + (L - S[i]) * X;
}
return Y + X * L;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |