제출 #980961

#제출 시각아이디문제언어결과실행 시간메모리
980961vjudge1추월 (IOI23_overtaking)C++17
0 / 100
2 ms3420 KiB
#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 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...