이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define rep(a,b,c) for(int a=b; a<c; a++)
#define repr(a,b,c) for(int a=b-1; a>c-1; a--)
#define repa(a,b) for(auto a:b)
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define pb push_back
using namespace std;
const int lim=2e5+5;
vector<pll> bus(lim);
vector<ll> ss;
ll n, m, l, x;
void init(int L, int N, std::vector<long long> T, std::vector<int> W, int X, int M, std::vector<int> S){
ss.clear();
rep(i,0,N) bus[i]={T[i],W[i]};
rep(i,0,M) ss.pb(S[i]);
x=X;
l=L;
n=N;
m=M;
}
long long arrival_time(long long Y){
if(Y<=bus[0].fi) return Y+(x*l);
//cout<<bus[0].fi<<" "<<bus[0].se<<" "<<x<<" "<<Y<<" "<<l<<endl;
repa(e,ss){
if(bus[0].fi+bus[0].se*e>=Y+x*e){
return bus[0].fi+(x*(l-e));
}
}
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... |