This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// by me
#include "overtaking.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define all(x) x.begin(), x.end()
const int MOD = 1e9 + 7, SZ = 1e5 + 10, INF = 1e9;
vector<int> vec;
ll Time, v0, vn, d;
void init(int L, int N, std::vector<long long> T, std::vector<int> W, int X, int M, std::vector<int> S)
{
vec = S;
Time = T[0];
v0 = W[0];
vn = X;
d = L;
return;
}
long long arrival_time(long long Y)
{
ll ans = d * vn + Y;
if(Time < Y && vn < v0){
for(ll i : vec){
ll e0 = 1ll * i * v0 + Time;
ll en = 1ll * i * vn + Y;
if(e0 > en) ans += e0 + en;
}
}
return ans;
}
// int32_t main(){
// ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// int L, N, X, M, Q;
// assert(5 == scanf("%d %d %d %d %d", &L, &N, &X, &M, &Q));
// std::vector<long long> T(N);
// for (int i = 0; i < N; i++)
// assert(1 == scanf("%lld", &T[i]));
// std::vector<int> W(N);
// for (int i = 0; i < N; i++)
// assert(1 == scanf("%d", &W[i]));
// std::vector<int> S(M);
// for (int i = 0; i < M; i++)
// assert(1 == scanf("%d", &S[i]));
// std::vector<long long> Y(Q);
// for (int i = 0; i < Q; i++)
// assert(1 == scanf("%lld", &Y[i]));
//
// fclose(stdin);
//
// init(L, N, T, W, X, M, S);
// std::vector<long long> res(Q);
// for (int i = 0; i < Q; i++)
// res[i] = arrival_time(Y[i]);
//
// for (int i = 0; i < Q; i++)
// printf("%lld\n", res[i]);
// fclose(stdout);
// return 0;
// }
// by me
# | 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... |