Submission #848809

#TimeUsernameProblemLanguageResultExecution timeMemory
848809NaserOvertaking (IOI23_overtaking)C++17
0 / 100
1 ms2392 KiB
#include <bits/stdc++.h> //#define int long long #define endl '\n' #define pii pair<int,int> #define vint vector<int> #define vll vector<long long> #define vpii vector<pii> #define pb push_back #define se second #define fi first #define all(x) x.begin(), x.end() #define graph vector<vector<int>> using namespace std; const int N = (int)2e5 + 69; const int mod = (int)1e4 + 7; const int naser = 3999, tourist = 3816; int power(int a, int b) { int ans = 1; while (b) { if (b % 2) ans *= a; a *= a; b /= 2; } return ans; } long long ex[1001][1001], ti[1001][1001], y, x, n, m; vint tmp, w, s; vll t; bool cmp(int a, int b) { long double aa = -1; if (w[a] != x) aa = (y - t[a]) / (w[a] - x); long double bb = -1; if (w[b] != x) bb = (y - t[b]) / (w[b] - x); return aa < bb; } void init(int l, int N, vll T, vint W, int X, int M, vint S) { t = T; w = W; s = S; x = X; n = N; m = M; tmp.resize(n); for (int i = 0; i < n; i++) tmp[i] = i; for (int i = 0; i < n; i++) ti[i][0] = t[i]; for (int i = 0; i < n; i++) { ti[i][1] = t[i] + (s[1] - s[0]) * w[i]; for (int j = 0; j < n; j++) { if (t[j] < t[i]) ti[i][1] = max(ti[i][1], ti[j][1]); } } } long long arrival_time(long long Y) { y = Y; long long ans = y + (s[1] - s[0]) * x; for (int i = 0; i < n; i++) { if (t[i] < y) ans = max(ans, ti[i][1]); } return ans; } //int32_t main() { // // init(6, 4, { 20, 10, 40, 0 }, { 5, 20, 20, 30 }, 10, 2, { 0, 1, 3, 6 }); // //init(6, 2, { 10, 20 }, { 5, 3 }, 2, 2, { 0, 6 }); // while (naser > tourist) { // int y; // cin >> y; // cout << arrival_time(y) << endl; // } // //}
#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...