Submission #00418


ソースコード

ステータス

項目 データ
問題 0004 - 2 番目に大きい整数
ユーザー名 R2528
投稿日時 2025-08-21 11:37:28
言語 C++
状態 Compile Error
得点 0
ソースコード長 210 Byte
最大実行時間 -
最大メモリ使用量

コンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:6:14: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
     ans1=max({a,b,c});
              ^
./Main.cpp:6:21: error: no matching function for call to ‘max(<brace-enclosed initializer list>)’
     ans1=max({a,b,c});
                     ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/algorithm:61,
                 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_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:6:21: note:   candidate expects 2 arguments, 1 provided
     ans1=max({a,b,c});
                     ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/algorithm:61,
                 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_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:6:21: note:   candidate expects 3 arguments, 1 provided
     ans1=max({a,b,c});
                     ^
./Main.cpp:7:14: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
     ans2=min({a,b,c});
              ^
./Main.cpp:7:21: error: no matching function for call to ‘min(<brace-enclosed initializer list>)’
     ans2=min({a,b,c});
                     ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/algorithm:61,
                 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_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:7:21: note:   candidate expects 2 arguments, 1 provided
     ans2=min({a,b,c});
                     ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/algorithm:61,
                 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_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:7:21: note:   candidate expects 3 arguments, 1 provided
     ans2=min({a,b,c});
                     ^

セット

セット 得点 Cases

テストケース

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