ID 5782799
Пользователь Thanks to the CWC partners from the GreenTeaNeko
Время 00:10<< 16.11.2021 00:11 (26 д. 22:11) 00:12>>
Обработка 00:11 ... 00:11 (2,22 сек.)
Файл 5782799.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача A: Набор фигур
Набор тестов
Ограничения Время: 1с Память: 4096Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:17:0:
figure.h:22:12: error: 'std::__cxx11::string Triangle::Name()' marked 'override', but does not override
     string Name() override {
            ^~~~
figure.h:25:12: error: 'double Triangle::Perimeter()' marked 'override', but does not override
     double Perimeter() override {
            ^~~~~~~~~
figure.h:28:12: error: 'double Triangle::Area()' marked 'override', but does not override
     double Area() override {
            ^~~~
figure.h:42:12: error: 'std::__cxx11::string Rect::Name()' marked 'override', but does not override
     string Name() override {
            ^~~~
figure.h:45:12: error: 'double Rect::Perimeter()' marked 'override', but does not override
     double Perimeter() override {
            ^~~~~~~~~
figure.h:48:12: error: 'double Rect::Area()' marked 'override', but does not override
     double Area() override {
            ^~~~
figure.h:60:12: error: 'std::__cxx11::string Circle::Name()' marked 'override', but does not override
     string Name() override {
            ^~~~
figure.h:63:12: error: 'double Circle::Perimeter()' marked 'override', but does not override
     double Perimeter() override {
            ^~~~~~~~~
figure.h:66:12: error: 'double Circle::Area()' marked 'override', but does not override
     double Area() override {
            ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:1:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Rect; _Args = {double&, double&}; _Tp = Rect]':
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Rect; _Args = {double&, double&}; _Tp = Rect; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Rect>]'
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from 'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {double&, double&}; _Tp = Rect; _Alloc = std::allocator<Rect>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from 'std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = Rect; _Alloc = std::allocator<Rect>; _Args = {double&, double&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Rect>; _Args = {double&, double&}; _Tp = Rect; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Rect>; _Args = {double&, double&}; _Tp = Rect]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Rect; _Alloc = std::allocator<Rect>; _Args = {double&, double&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Rect; _Args = {double&, double&}]'
figure.h:80:48:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Rect'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:38:7: note:   because the following virtual functions are pure within 'Rect':
 class Rect : public Figure {
       ^~~~
figure.h:14:18: note: 	virtual std::__cxx11::string Figure::Name() const
   virtual string Name() const = 0;
                  ^~~~
figure.h:15:18: note: 	virtual double Figure::Perimeter() const
   virtual double Perimeter() const = 0;
                  ^~~~~~~~~
figure.h:16:18: note: 	virtual double Figure::Area() const
   virtual double Area() const = 0;
                  ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:1:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Triangle; _Args = {double&, double&, double&}; _Tp = Triangle]':
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Triangle; _Args = {double&, double&, double&}; _Tp = Triangle; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Triangle>]'
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from 'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {double&, double&, double&}; _Tp = Triangle; _Alloc = std::allocator<Triangle>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from 'std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = Triangle; _Alloc = std::allocator<Triangle>; _Args = {double&, double&, double&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Triangle>; _Args = {double&, double&, double&}; _Tp = Triangle; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Triangle>; _Args = {double&, double&, double&}; _Tp = Triangle]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Triangle; _Alloc = std::allocator<Triangle>; _Args = {double&, double&, double&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Triangle; _Args = {double&, double&, double&}]'
figure.h:84:46:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Triangle'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:19:7: note:   because the following virtual functions are pure within 'Triangle':
 class Triangle : public Figure {
       ^~~~~~~~
figure.h:14:18: note: 	virtual std::__cxx11::string Figure::Name() const
   virtual string Name() const = 0;
                  ^~~~
figure.h:15:18: note: 	virtual double Figure::Perimeter() const
   virtual double Perimeter() const = 0;
                  ^~~~~~~~~
figure.h:16:18: note: 	virtual double Figure::Area() const
   virtual double Area() const = 0;
                  ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:1:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Circle; _Args = {double&}; _Tp = Circle]':
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Circle; _Args = {double&}; _Tp = Circle; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Circle>]'
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from 'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {double&}; _Tp = Circle; _Alloc = std::allocator<Circle>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from 'std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = Circle; _Alloc = std::allocator<Circle>; _Args = {double&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Circle>; _Args = {double&}; _Tp = Circle; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Circle>; _Args = {double&}; _Tp = Circle]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Circle; _Alloc = std::allocator<Circle>; _Args = {double&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Circle; _Args = {double&}]'
figure.h:88:38:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Circle'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:57:7: note:   because the following virtual functions are pure within 'Circle':
 class Circle : public Figure {
       ^~~~~~
figure.h:14:18: note: 	virtual std::__cxx11::string Figure::Name() const
   virtual string Name() const = 0;
                  ^~~~
figure.h:15:18: note: 	virtual double Figure::Perimeter() const
   virtual double Perimeter() const = 0;
                  ^~~~~~~~~
figure.h:16:18: note: 	virtual double Figure::Area() const
   virtual double Area() const = 0;
                  ^~~~
0.086s 0.009s 9