Submission #1242296

#TimeUsernameProblemLanguageResultExecution timeMemory
1242296banganOvertaking (IOI23_overtaking)C++20
0 / 100
0 ms328 KiB
#include "overtaking.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back int n; vector<ll> t, w; int m; vector<ll> s; void init(int L, int N, std::vector<long long> T, std::vector<int> W, int X, int M, std::vector<int> S) { n = N; for (auto it : T) t.pb(it); t.pb(0); for (auto it : W) w.pb(it); w.pb(X); m = M; for (auto it : S) s.pb(it); assert(s[0]==0); assert(s[m-1]==L); } ll arrival_time(ll Y) { t[n] = Y; ll x = t[0]; ll y = t[1]; for (int i=1; i<m; i++) { ll new_x = x + (s[i] - s[i-1]) * w[0]; ll new_y = y + (s[i] - s[i-1]) * w[1]; if (new_x < new_y && y < x) new_y = new_x; else if (new_y < new_x && x < y) new_x = new_y; x = new_x; y = new_y; } return y; }
#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...