记录详情

Wrong Answer

foo.cc: In static member function 'static void Complex::Sort(std::vector<Complex>*)':
foo.cc:99:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   99 |                 for (i = 0; i<ptr_vtInstance->size(); i++)
      |                             ~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc:106:47: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  106 |                                 for (j = 0; j < ptr_vtComplex->size(); j++)
      |                                             ~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc:115:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  115 |                                 if (j == ptr_vtComplex->size())
      |                                     ~~^~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:120:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  120 |                 for (i = 0; i<ptr_vtComplex->size(); i++)
      |                             ~^~~~~~~~~~~~~~~~~~~~~~
foo.cc: In static member function 'static void Complex::VectorDisplay(std::vector<Complex>*)':
foo.cc:156:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  156 |                 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:217:17:
foo.cc:132:54: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
  132 |                                 if (ary_objComplex[j]>ary_objComplex[j + 1])
      |                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In member function 'bool Complex::operator>(Complex)',
    inlined from 'static void Complex::Bubble(Complex*, int)' at foo.cc:132:26,
    inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:68:29: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
   68 |                 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:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In member function 'bool Complex::operator>(Complex)',
    inlined from 'static void Complex::Bubble(Complex*, int)' at foo.cc:132:26,
    inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:68:50: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
   68 |                 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:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:135:59: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
  135 |                                         ary_objComplex[j] = ary_objComplex[j + 1];
      |                                         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:135:59: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
  135 |                                         ary_objComplex[j] = ary_objComplex[j + 1];
      |                                         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:136:63: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
  136 |                                         ary_objComplex[j + 1] = objTemp;
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In static member function 'static void Complex::Bubble(Complex*, int)',
    inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:136:63: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
  136 |                                         ary_objComplex[j + 1] = objTemp;
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In member function 'void Complex::setReal(int)',
    inlined from 'int main(int, char**)' at foo.cc:214:28:
foo.cc:33:28: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
   33 |                 this->real = real;
      |                 ~~~~~~~~~~~^~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
In member function 'void Complex::setImaginary(int)',
    inlined from 'int main(int, char**)' at foo.cc:215:33:
foo.cc:42:33: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
   42 |                 this->imaginary = imaginary;
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
  208 |         ary_objComplex = new Complex[nSize];
      |                                           ^
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer 0a1,3 > 0+1i > 3 > 4-5i 5ms 400.0 KiB
#2 Wrong Answer 0a1,4 > 0+1i > 2 > 3 > 4-5i 5ms 404.0 KiB
#3 Wrong Answer 0a1,5 > 0+1i > 2 > 3 > 4-5i 3ms 284.0 KiB
#4 Wrong Answer 0a1,6 > 0+1i > 2 > 3 > 4-5i 3ms 284.0 KiB
#5 Wrong Answer 0a1,9 > 0+1i > 2 > 3 > 4-5i 3ms 284.0 KiB

信息

递交者
类型
递交
题目
P1013 OO2-3 复数数组类的冒泡排序
语言
C++
递交时间
2023-10-03 04:15:19
评测时间
2023-10-03 04:15:19
评测机
分数
0
总耗时
22ms
峰值内存
404.0 KiB