Submission #955560

#TimeUsernameProblemLanguageResultExecution timeMemory
955560Prieved1Overtaking (IOI23_overtaking)C++17
0 / 100
1 ms348 KiB
#include "overtaking.h" #include <bits/stdc++.h> using namespace std; int speed; vector<vector<long long>> ta; vector<int> ss; void init(int L, int N, std::vector<long long> T, std::vector<int> W, int X, int M, std::vector<int> S) { speed=X; ta=vector<vector<long long>> (M, vector<long long> (N)); ss=S; for(int i = 0;i<M;i++) { for(int j = 0;j<N;j++) { if(i==0)ta[i][j]=T[j]; else ta[i][j]=ta[i-1][j]+(S[i]-S[i-1])*W[j]; } if(i){ for(int j = 0;j<N;j++){ for(int k = 0;k<N;k++) { if(ta[i-1][j]>ta[i-1][k])ta[i][j]=max(ta[i][j], ta[i][k]); } } } } } long long arrival_time(long long Y) { long long pr=Y; long long cur=pr; for(int i = 1;i<ta.size();i++) { cur+=(ss[i]-ss[i-1])*speed; for(int j = 0;j<ta[i].size();j++) { if(ta[i-1][j]<pr)cur=max(cur, ta[i][j]); } pr=cur; } return cur; }

Compilation message (stderr)

overtaking.cpp: In function 'long long int arrival_time(long long int)':
overtaking.cpp:30:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |   for(int i = 1;i<ta.size();i++) {
      |                 ~^~~~~~~~~~
overtaking.cpp:32:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for(int j = 0;j<ta[i].size();j++) {
      |                   ~^~~~~~~~~~~~~
#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...