Submission #00137
ソースコード
ステータス
コンパイルメッセージ
./Main.cpp: In function ‘int main()’:
./Main.cpp:15:49: error: cannot convert ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >’ to ‘int’ in assignment
hh=min_element(t.begin(),t.end());
^
./Main.cpp:17:21: error: no match for ‘operator[]’ (operand types are ‘std::vector<long long int>’ and ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >’)
ge=a[min_element(t.begin(),t.end())];
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/vector:64,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/queue:61,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:86,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:930:7: note: candidate: ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::reference = long long int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’
operator[](size_type __n) _GLIBCXX_NOEXCEPT
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:930:7: note: no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >’ to ‘std::vector<long long int>::size_type’ {aka ‘long unsigned int’}
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:948:7: note: candidate: ‘std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::const_reference = const long long int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’
operator[](size_type __n) const _GLIBCXX_NOEXCEPT
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:948:7: note: no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >’ to ‘std::vector<long long int>::size_type’ {aka ‘long unsigned int’}
./Main.cpp:18:18: error: no match for ‘operator[]’ (operand types are ‘std::vector<long long int>’ and ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >’)
a[min_element(t.begin(),t.end())]=LONG_LONG_MAX;
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/vector:64,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/queue:61,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:86,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:930:7: note: candidate: ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::reference = long long int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’
operator[](size_type __n) _GLIBCXX_NOEXCEPT
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:930:7: note: no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >’ to ‘std::vector<long long int>::size_type’ {aka ‘long unsigned int’}
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:948:7: note: candidate: ‘std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::const_reference = const long long int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’
operator[](size_type __n) const _GLIBCXX_NOEXCEPT
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:948:7: note: no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >’ to ‘std::vector<long long int>::size_type’ {aka ‘long unsigned int’}
セット
テストケース