Submission #00061


ソースコード

ステータス

項目 データ
問題 0002 - water
ユーザー名 noshi91
投稿日時 2017-11-26 13:05:50
言語 C++17
状態 Compile Error
得点 0
ソースコード長 949 Byte
最大実行時間 -
最大メモリ使用量

コンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:42:38: error: no matching function for call to ‘min(int, int32)’
                 x = min(100, x + a[i]);
                                      ^
In file included from /usr/local/gcc-7.1.0/include/c++/7.1.0/bits/char_traits.h:39:0,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/ios:40,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/ostream:38,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/iostream:39,
                 from ./Main.cpp:1:
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algobase.h:195:5: note: candidate: template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algobase.h:195:5: note:   template argument deduction/substitution failed:
./Main.cpp:42:38: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘int32 {aka long int}’)
                 x = min(100, x + a[i]);
                                      ^
In file included from /usr/local/gcc-7.1.0/include/c++/7.1.0/bits/char_traits.h:39:0,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/ios:40,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/ostream:38,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/iostream:39,
                 from ./Main.cpp:1:
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algobase.h:243:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algobase.h:243:5: note:   template argument deduction/substitution failed:
./Main.cpp:42:38: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘int32 {aka long int}’)
                 x = min(100, x + a[i]);
                                      ^
In file included from /usr/local/gcc-7.1.0/include/c++/7.1.0/algorithm:62:0,
                 from ./Main.cpp:2:
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algo.h:3450:5: note: candidate: template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)
     min(initializer_list<_Tp> __l)
     ^~~
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algo.h:3450:5: note:   template argument deduction/substitution failed:
./Main.cpp:42:38: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
                 x = min(100, x + a[i]);
                                      ^
In file included from /usr/local/gcc-7.1.0/include/c++/7.1.0/algorithm:62:0,
                 from ./Main.cpp:2:
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algo.h:3456:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algo.h:3456:5: note:   template argument deduction/substitution failed:
./Main.cpp:42:38: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
                 x = min(100, x + a[i]);
                                      ^
./Main.cpp:43:36: error: no matching function for call to ‘max(int, int32)’
                 x = max(0, x - b[i]);
                                    ^
In file included from /usr/local/gcc-7.1.0/include/c++/7.1.0/bits/char_traits.h:39:0,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/ios:40,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/ostream:38,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/iostream:39,
                 from ./Main.cpp:1:
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algobase.h:219:5: note:   template argument deduction/substitution failed:
./Main.cpp:43:36: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘int32 {aka long int}’)
                 x = max(0, x - b[i]);
                                    ^
In file included from /usr/local/gcc-7.1.0/include/c++/7.1.0/bits/char_traits.h:39:0,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/ios:40,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/ostream:38,
                 from /usr/local/gcc-7.1.0/include/c++/7.1.0/iostream:39,
                 from ./Main.cpp:1:
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algobase.h:265:5: note:   template argument deduction/substitution failed:
./Main.cpp:43:36: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘int32 {aka long int}’)
                 x = max(0, x - b[i]);
                                    ^
In file included from /usr/local/gcc-7.1.0/include/c++/7.1.0/algorithm:62:0,
                 from ./Main.cpp:2:
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algo.h:3462:5: note: candidate: template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algo.h:3462:5: note:   template argument deduction/substitution failed:
./Main.cpp:43:36: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
                 x = max(0, x - b[i]);
                                    ^
In file included from /usr/local/gcc-7.1.0/include/c++/7.1.0/algorithm:62:0,
                 from ./Main.cpp:2:
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algo.h:3468:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/local/gcc-7.1.0/include/c++/7.1.0/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
./Main.cpp:43:36: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
                 x = max(0, x - b[i]);
                                    ^

セット

セット 得点 Cases

テストケース

ファイル名 状態 実行時間 メモリ使用量 #