제출 #1057868

#제출 시각아이디문제언어결과실행 시간메모리
1057868TheQuantiX추월 (IOI23_overtaking)C++17
39 / 100
3521 ms596 KiB
#include <bits/stdc++.h> #include "overtaking.h" using namespace std; using ll = long long; ll n, m, q, k, x, y, a, b, c, l; vector<ll> t; vector<int> w, s; void init(int L, int N, vector<long long> T, vector<int> W, int X, int M, vector<int> S) { n = N; m = M; l = L; x = X; t = T; w = W; s = S; } long long arrival_time(long long Y) { vector< pair<ll, ll> > v; for (int i = 0; i < n; i++) { v.push_back({t[i], i}); } v.push_back({Y, n}); for (int i = 1; i < m; i++) { sort(v.begin(), v.end()); // for (auto j : v) { // cout << j.first << ' ' << j.second << " "; // } // cout << '\n'; vector< pair<ll, ll> > e; ll mx = 0; for (int j = 0; j < v.size(); j++) { vector< pair<ll, ll> > e2; ll x1 = v[j].first; while (v[j].first == x1) { e2.push_back({v[j].first + (v[j].second == n ? x : w[v[j].second]) * (s[i] - s[i - 1]), v[j].second}); j++; } for (auto &i : e2) { i.first = max(mx, i.first); } for (auto &i : e2) { mx = max(i.first, mx); e.push_back(i); } j--; } swap(e, v); } // cout << '\n'; for (auto i : v) { if (i.second == n) { return i.first; } } }

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

overtaking.cpp: In function 'long long int arrival_time(long long int)':
overtaking.cpp:35:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |         for (int j = 0; j < v.size(); j++) {
      |                         ~~^~~~~~~~~~
overtaking.cpp:22:28: warning: control reaches end of non-void function [-Wreturn-type]
   22 |     vector< pair<ll, ll> > v;
      |                            ^
#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...