Submission #64395
ソースコード
ステータス
項目 |
データ |
問題 |
1417 - Cake Cutting |
ユーザー名 |
ei1903
|
投稿日時 |
2020-10-21 17:25:56 |
言語 |
C++17 |
状態 |
Compile Error |
得点 |
0
|
ソースコード長 |
148 Byte |
最大実行時間 |
-
|
最大メモリ使用量 |
|
コンパイルメッセージ
./Main.cpp: In function ‘int main()’:
./Main.cpp:9:31: error: no match for ‘operator<’ (operand types are ‘std::basic_ostream<char>’ and ‘char’)
cout << (n / 2) * (n % 2) < '\n';
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
./Main.cpp:9:31: note: candidate: ‘operator<(int, int)’ <built-in>
./Main.cpp:9:31: note: no known conversion for argument 1 from ‘std::basic_ostream<char>’ to ‘int’
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:64,
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/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:449:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)’
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:449:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::pair<_T1, _T2>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:67,
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/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_iterator.h:305:5: note: candidate: ‘template<class _Iterator> constexpr bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)’
operator<(const reverse_iterator<_Iterator>& __x,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_iterator.h:305:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:67,
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/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_iterator.h:343:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)’
operator<(const reverse_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_iterator.h:343:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:67,
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/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_iterator.h:1136:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)’
operator<(const move_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_iterator.h:1136:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::move_iterator<_IteratorL>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_algobase.h:67,
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/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_iterator.h:1142:5: note: candidate: ‘template<class _Iterator> constexpr bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)’
operator<(const move_iterator<_Iterator>& __x,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_iterator.h:1142:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::move_iterator<_IteratorL>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:48,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/string:52,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/locale_classes.h:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:41,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/string_view:472:5: note: candidate: ‘template<class _CharT, class _Traits> constexpr bool std::operator<(std::basic_string_view<_CharT, _Traits>, std::basic_string_view<_CharT, _Traits>)’
operator< (basic_string_view<_CharT, _Traits> __x,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/string_view:472:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘std::basic_string_view<_CharT, _Traits>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:48,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/string:52,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/locale_classes.h:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:41,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/string_view:478:5: note: candidate: ‘template<class _CharT, class _Traits> constexpr bool std::operator<(std::basic_string_view<_CharT, _Traits>, std::__detail::__idt<std::basic_string_view<_CharT, _Traits> >)’
operator< (basic_string_view<_CharT, _Traits> __x,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/string_view:478:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘std::basic_string_view<_CharT, _Traits>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:48,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/string:52,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/locale_classes.h:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:41,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/string_view:484:5: note: candidate: ‘template<class _CharT, class _Traits> constexpr bool std::operator<(std::__detail::__idt<std::basic_string_view<_CharT, _Traits> >, std::basic_string_view<_CharT, _Traits>)’
operator< (__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/string_view:484:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: mismatched types ‘std::basic_string_view<_CharT, _Traits>’ and ‘char’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/string:52,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/locale_classes.h:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:41,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:6124:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)’
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:6124:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/string:52,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/locale_classes.h:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:41,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:6137:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)’
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:6137:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: ‘std::basic_ostream<char>’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/string:52,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/locale_classes.h:40,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:41,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:6149:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)’
operator<(const _CharT* __lhs,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/basic_string.h:6149:5: note: template argument deduction/substitution failed:
./Main.cpp:9:33: note: mismatched types ‘const _CharT*’ and ‘std::basic_ostream<char>’
cout << (n / 2) * (n % 2) < '\n';
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:46,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/ostream:38,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/iostream:39,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/system_error:208:3: note: candidate: ‘bool std::operator<(const std::error_code&, const std::error_code&)’
operator<(const error_code& __lhs, const error_code& __rhs) noexcept
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/system_error:208:3: note: no known conversion for argument 1 from ‘std::basic_ostream<char>’ to ‘const std::error_code&’
/usr/local/gcc-8.2.0/include/c++/8.2.0/system_error:282:3: note: candidate: ‘bool std::operator<(const std::error_condition&, const std::error_condition&)’
operator<(const error_condition& __lhs,
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/system_error:282:3: note: no known conversion for argument 1 from ‘std::basic_ostream<char>’ to ‘const std::error_condition&’
セット
テストケース