Submission #847734

#TimeUsernameProblemLanguageResultExecution timeMemory
847734vjudge1추월 (IOI23_overtaking)C++17
Compilation error
0 ms0 KiB
#include "overtaking.h" #include <bits/stdc++.h> using namespace std; vector<int> W, S; vector<int64_t> T; int N, L, M, X; void init(int L, int N, std::vector<long long> T, std::vector<int> W, int X, int M, std::vector<int> S) { ::T = T; ::W = W; ::S = S; ::N = N; ::L = L; ::M = M; ::X = X; ::W.emplace_back(X); ::T.emplace_back(0); ::N++; } long long arrival_time(long long Y) { vector<vector<int64_t>> t(M, vector<int64_t>(N)); vector<vector<int64_t>> e(M, vector<int64_t>(N)); T.back() = Y; for (int i = 0; i < N; i++) t[0][i] = T[i]; vector<int> ord(N); iota(ord.begin(), ord.end(), 0); for (int i = 0; i < M - 1; i++) { for (int j = 0; j < N; j++) { e[i + 1][j] = t[i][j] + 1ll * W[j] * (S[i + 1] - S[i]); } sort(ord.begin(), ord.end(), [&](int a, int b) { return t[i][a] < t[i][b]; }); int64_t time = 0; for (int j = 0; j < N;) { int k = j; while (k < N && t[i][ord[k]] == t[i][ord[j]]) k++; for (int z = j; z < k; z++) t[i + 1][ord[z]] = max(time, e[i + 1][ord[z]]); for (int z = j; z < k; z++) time = max(time, e[i + 1][ord[z]]); j = k; } } return t.back().back(); }

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:11:15: error: no match for 'operator=' (operand types are 'std::vector<long int>' and 'std::vector<long long int>')
   11 |         ::T = T;
      |               ^
In file included from /usr/include/c++/10/vector:72,
                 from overtaking.h:1,
                 from overtaking.cpp:1:
/usr/include/c++/10/bits/vector.tcc:198:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  198 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/vector.tcc:199:42: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const std::vector<long int>&'
  199 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/10/vector:67,
                 from overtaking.h:1,
                 from overtaking.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:709:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  709 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:709:26: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::vector<long int>&&'
  709 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:730:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  730 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:730:46: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::initializer_list<long int>'
  730 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~