제출 #1132794

#제출 시각아이디문제언어결과실행 시간메모리
1132794SpyrosAliv추월 (IOI23_overtaking)C++20
0 / 100
1 ms324 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long vector<ll> start; // start time of each bus vector<int> speed;//bus speed vector<int> stops; int len; // size of road int n, m; // number of buses and stations int xsp; // reserve travel time void init(int L, int N, vector<ll> T, vector<int> W, int X, int M, vector<int> S) { len = L; n = N; start = T; speed = W; xsp = X; m = M; stops = S; } ll arrival_time(ll st) { vector<tuple<ll, int, bool>> currTimes; for (int i = 0; i < n; i++) { currTimes.push_back({start[i], speed[i], false}); } currTimes.push_back({st, xsp, true}); for (int i = 0; i < m-1; i++) { sort(currTimes.begin(), currTimes.end()); vector<tuple<ll, int, bool>> nxt; ll maxTime = -1; int dis = stops[i+1] - stops[i]; for (auto [currTime, sp, special]: currTimes) { ll nxtTime = currTime + sp * dis; nxtTime = max(nxtTime, maxTime); maxTime = max(maxTime, nxtTime); nxt.push_back({nxtTime, sp, special}); } currTimes = nxt; } for (auto [a, b, c]: currTimes) { if (c == true) { return a; } } }

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

overtaking.cpp: In function 'long long int arrival_time(long long int)':
overtaking.cpp:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
#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...