Submission #00086
ソースコード
ステータス
項目 |
データ |
問題 |
0006 - セグメントツリー技術基礎 |
ユーザー名 |
ei2122
|
投稿日時 |
2022-02-04 16:19:33 |
言語 |
C++11 |
状態 |
Compile Error |
得点 |
0
|
ソースコード長 |
3146 Byte |
最大実行時間 |
-
|
最大メモリ使用量 |
|
コンパイルメッセージ
./Main.cpp: In member function ‘void Segtree::updata(int, int)’:
./Main.cpp:25:40: error: no matching function for call to ‘max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, int&)’
value_max[i]=max(value_max[i],x);
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/char_traits.h:39,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/istream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/sstream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/complex:45,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ccomplex:39,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:52,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:219:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
./Main.cpp:25:40: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
value_max[i]=max(value_max[i],x);
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/char_traits.h:39,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/istream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/sstream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/complex:45,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ccomplex:39,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:52,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:265:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
./Main.cpp:25:40: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
value_max[i]=max(value_max[i],x);
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/algorithm:62,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:65,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algo.h:3462:5: note: candidate: ‘template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)’
max(initializer_list<_Tp> __l)
^~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed:
./Main.cpp:25:40: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
value_max[i]=max(value_max[i],x);
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/algorithm:62,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:65,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algo.h:3468:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)’
max(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed:
./Main.cpp:25:40: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
value_max[i]=max(value_max[i],x);
^
./Main.cpp:26:40: error: no matching function for call to ‘min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, int&)’
value_min[i]=min(value_min[i],x);
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/char_traits.h:39,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/istream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/sstream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/complex:45,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ccomplex:39,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:52,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:195:5: note: candidate: ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
min(const _Tp& __a, const _Tp& __b)
^~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
./Main.cpp:26:40: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
value_min[i]=min(value_min[i],x);
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/char_traits.h:39,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/istream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/sstream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/complex:45,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ccomplex:39,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:52,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:243:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed:
./Main.cpp:26:40: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
value_min[i]=min(value_min[i],x);
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/algorithm:62,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:65,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algo.h:3450:5: note: candidate: ‘template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)’
min(initializer_list<_Tp> __l)
^~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algo.h:3450:5: note: template argument deduction/substitution failed:
./Main.cpp:26:40: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
value_min[i]=min(value_min[i],x);
^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/algorithm:62,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:65,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algo.h:3456:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)’
min(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algo.h:3456:5: note: template argument deduction/substitution failed:
./Main.cpp:26:40: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
value_min[i]=min(value_min[i],x);
^
セット
テストケース