Submission #1038985

#TimeUsernameProblemLanguageResultExecution timeMemory
1038985ZicrusOvertaking (IOI23_overtaking)C++17
9 / 100
2 ms476 KiB
#include <bits/stdc++.h> #include "overtaking.h" using namespace std; typedef long long ll; vector<ll> tCur, tNxt; vector<ll> s; ll x, m; void init(int l, int n, vector<ll> t, vector<int> w, int x1, int m1, vector<int> s1) { s = vector<ll>(s1.size()); for (int i = 0; i < s1.size(); i++) s[i] = s1[i]; m = m1; x = x1; tCur = vector<ll>(m-1); tNxt = vector<ll>(m-1); ll start = t[0], timePerKm = w[0]; for (int t = 0; t < m-1; t++) { ll idealNxt = start + timePerKm * ((ll)s[t+1] - (ll)s[t]); tCur[t] = start; tNxt[t] = idealNxt; start = idealNxt; } } ll arrival_time(ll y) { for (int t = 0; t < m-1; t++) { ll idealNxt = y + x * (s[t+1] - s[t]); if (tCur[t] < y) idealNxt = max(idealNxt, tNxt[t]); y = idealNxt; } return y; }

Compilation message (stderr)

overtaking.cpp: In function 'void init(int, int, std::vector<long long int>, std::vector<int>, int, int, std::vector<int>)':
overtaking.cpp:13:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for (int i = 0; i < s1.size(); i++) s[i] = s1[i];
      |                     ~~^~~~~~~~~~~
#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...