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"
ll 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] + (ll)W[0] * (ll)S[i];
return;
}
ll arrival_time(ll Y)
{
for (int i = 1; i < M; i++)
{
if (Y + (ll)S[i-1] * X > arrival[i-1] && Y + (ll)S[i] * X < arrival[i])
return arrival[i] + (L - (ll)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... |