제출 #955565

#제출 시각아이디문제언어결과실행 시간메모리
955565Prieved1추월 (IOI23_overtaking)C++17
39 / 100
3513 ms8360 KiB
#include "overtaking.h" #include <iostream> #include <vector> #include <algorithm> using namespace std; long long 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]+(long long)(S[i]-S[i-1])*W[j]; } if(i){ vector<pair<pair<long long, long long>, int>> idxx; for(int j = 0;j<N;j++) { idxx.push_back({{ta[i-1][j], ta[i][j]}, j}); } sort(idxx.begin(), idxx.end()); for(int k = 1;k<N;k++) { ta[i][idxx[k].second]=max(ta[i][idxx[k].second], ta[i][idxx[k-1].second]); } } } } 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; }

컴파일 시 표준 에러 (stderr) 메시지

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