QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#36015#972. CircleHuangHanShengCompile Error//C++175.6kb2022-06-22 13:49:252022-06-22 13:49:26

詳細信息

answer.code: In lambda function:
answer.code:150:28: error: no match for ‘operator+’ (operand types are ‘Point’ {aka ‘Vector’} and ‘Float’ {aka ‘double’})
  150 |             Point p = {c.o + c.r * cos(x), c.o + c.r * sin(x)};
      |                        ~~~ ^ ~~~~~~~~~~~~
      |                          |       |
      |                          |       Float {aka double}
      |                          Point {aka Vector}
answer.code:23:12: note: candidate: ‘Vector Vector::operator+(Vector::CR) const’
   23 |     Vector operator+(CR b) const { return {x + b.x, y + b.y}; };
      |            ^~~~~~~~
answer.code:23:25: note:   no known conversion for argument 1 from ‘Float’ {aka ‘double’} to ‘Vector::CR’ {aka ‘const Vector&’}
   23 |     Vector operator+(CR b) const { return {x + b.x, y + b.y}; };
      |                      ~~~^
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_iterator.h:565:5: note: candidate: ‘template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)’
  565 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:565:5: note:   template argument deduction/substitution failed:
answer.code:150:41: note:   mismatched types ‘const std::reverse_iterator<_Iterator>’ and ‘Float’ {aka ‘double’}
  150 |             Point p = {c.o + c.r * cos(x), c.o + c.r * sin(x)};
      |                                         ^
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_iterator.h:1646:5: note: candidate: ‘template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename std::move_iterator<_IteratorL>::difference_type, const std::move_iterator<_IteratorL>&)’
 1646 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:1646:5: note:   template argument deduction/substitution failed:
answer.code:150:41: note:   mismatched types ‘const std::move_iterator<_IteratorL>’ and ‘Float’ {aka ‘double’}
  150 |             Point p = {c.o + c.r * cos(x), c.o + c.r * sin(x)};
      |                                         ^
In file included from /usr/include/c++/11/string:55,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:1:
/usr/include/c++/11/bits/basic_string.h:6081:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)’
 6081 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/11/bits/basic_string.h:6081:5: note:   template argument deduction/substitution failed:
answer.code:150:41: note:   ‘Point’ {aka ‘Vector’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’
  150 |             Point p = {c.o + c.r * cos(x), c.o + c.r * sin(x)};
      |                                         ^
In file included from /usr/include/c++/11/string:56,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:1:
/usr/include/c++/11/bits/basic_string.tcc:1169:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)’
 1169 |     ...