记录详情

Wrong Answer

foo.cc: In static member function 'static void Complex::Sort(std::vector<Complex>*)':
foo.cc:100:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  100 |                 for (i = 0; i<ptr_vtInstance->size(); i++)
      |                             ~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc:107:47: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |                                 for (j = 0; j < ptr_vtComplex->size(); j++)
      |                                             ~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc:116:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  116 |                                 if (j == ptr_vtComplex->size())
      |                                     ~~^~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:121:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  121 |                 for (i = 0; i<ptr_vtComplex->size(); i++)
      |                             ~^~~~~~~~~~~~~~~~~~~~~~
foo.cc: In static member function 'static void Complex::VectorDisplay(std::vector<Complex>*)':
foo.cc:157:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  157 |                 for (i = 0; i < ptr_vtInstance->size(); i++)
      |                             ~~^~~~~~~~~~~~~~~~~~~~~~~~
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:190:17:
foo.cc:133:54: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
  133 |                                 if (ary_objComplex[j]>ary_objComplex[j + 1])
      |                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In member function 'bool Complex::operator>(Complex)',
    inlined from 'static void Complex::Bubble(Complex*, int)' at foo.cc:133:26,
    inlined from 'int main(int, char**)' at foo.cc:190:17:
foo.cc:69:29: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
   69 |                 if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) > sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
      |                          ~~~^~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In member function 'bool Complex::operator>(Complex)',
    inlined from 'static void Complex::Bubble(Complex*, int)' at foo.cc:133:26,
    inlined from 'int main(int, char**)' at foo.cc:190:17:
foo.cc:69:50: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
   69 |                 if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) > sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
      |                                               ~~~^~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:190:17:
foo.cc:136:59: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
  136 |                                         ary_objComplex[j] = ary_objComplex[j + 1];
      |                                         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:190:17:
foo.cc:136:59: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
  136 |                                         ary_objComplex[j] = ary_objComplex[j + 1];
      |                                         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:190:17:
foo.cc:137:63: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
  137 |                                         ary_objComplex[j + 1] = objTemp;
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:190:17:
foo.cc:137:63: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
  137 |                                         ary_objComplex[j + 1] = objTemp;
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In member function 'void Complex::setReal(int)',
    inlined from 'int main(int, char**)' at foo.cc:186:28:
foo.cc:34:28: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
   34 |                 this->real = real;
      |                 ~~~~~~~~~~~^~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In member function 'void Complex::setImaginary(int)',
    inlined from 'int main(int, char**)' at foo.cc:187:33:
foo.cc:43:33: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
   43 |                 this->imaginary = imaginary;
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In file included from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/x86_64-unknown-linux-gnu/bits/c++allocator.h:33,
                 from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/bits/allocator.h:46,
                 from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/string:41,
                 from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/bits/locale_classes.h:40,
                 from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/bits/ios_base.h:41,
                 from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/ios:42,
                 from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/ostream:38,
                 from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/iostream:39,
                 from foo.cc:6:
In member function 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Complex; _Args = {const Complex&}; _Tp = Complex]',
    inlined from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = Complex; _Args = {const Complex&}; _Tp = Complex]' at /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/bits/alloc_traits.h:516:17,
    inlined from 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Complex; _Alloc = std::allocator<Complex>]' at /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/bits/stl_vector.h:1281:30,
    inlined from 'int main(int, char**)' at foo.cc:188:22:
/nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/bits/new_allocator.h:175:11: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
  175 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:180:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  180 |         ary_objComplex = new Complex[nSize];
      |                                           ^
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 4ms 412.0 KiB
#2 Accepted 4ms 412.0 KiB
#3 Accepted 3ms 412.0 KiB
#4 Wrong Answer 0a1 > 0+1i 6d6 < 0+1i 5ms 412.0 KiB
#5 Wrong Answer Read 0+1i, expect 16+18i. 3ms 412.0 KiB

信息

递交者
类型
递交
题目
P1013 OO2-3 复数数组类的冒泡排序
语言
C++
递交时间
2023-10-03 06:27:47
评测时间
2023-10-03 06:27:47
评测机
分数
60
总耗时
21ms
峰值内存
412.0 KiB