/ Vijos /

记录详情

Compile Error

foo.cc: In member function 'constexpr Complex& Complex::operator+=(const Complex&) const':
foo.cc:18:8: error: assignment of member 'Complex::real' in read-only object
   18 |   real += other.real;
      |   ~~~~~^~~~~~~~~~~~~
foo.cc:19:8: error: assignment of member 'Complex::imag' in read-only object
   19 |   imag += other.imag;
      |   ~~~~~^~~~~~~~~~~~~
foo.cc:20:10: error: binding reference of type 'Complex&' to 'const Complex' discards qualifiers
   20 |   return *this;
      |          ^~~~~
foo.cc:21:2: error: body of 'constexpr' function 'constexpr Complex& Complex::operator+=(const Complex&) const' not a return-statement
   21 |  }
      |  ^
foo.cc: In member function 'constexpr Complex& Complex::operator*=(const Complex&) const':
foo.cc:36:26: error: passing 'const Complex' as 'this' argument discards qualifiers [-fpermissive]
   36 |   return *this = *this * other;
      |                          ^~~~~
foo.cc:8:8: note:   in call to 'Complex& Complex::operator=(Complex&&)'
    8 | struct Complex
      |        ^~~~~~~
foo.cc:36:16: error: binding reference of type 'Complex&' to 'const Complex' discards qualifiers
   36 |   return *this = *this * other;
      |          ~~~~~~^~~~~~~~~~~~~~~
foo.cc:37:2: error: body of 'constexpr' function 'constexpr Complex& Complex::operator*=(const Complex&) const' not a return-statement
   37 |  }
      |  ^
foo.cc: In function 'int main()':
foo.cc:98:31: warning: operation on 'length' may be undefined [-Wsequence-point]
   98 |  const int lengthD2 = (length = ((length += (len_a >> 1) + (len_a & 1)) > 1 ? 1 << ((length = 31 - __builtin_clz(length) + ((length & (length - 1)) > 0))) : 2)) >> 1;
      |                       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:98:31: warning: operation on 'length' may be undefined [-Wsequence-point]
foo.cc:98:31: warning: operation on 'length' may be undefined [-Wsequence-point]
foo.cc:167:18: warning: unused variable 'p' [-Wunused-variable]
  167 |  for (int i = 2, p = 0; i <= len_ans; i += 2)
      |                  ^
foo.cc:62:7: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   62 |  fread(buf_in, 1, 2097152, stdin);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P2000 A x B Problem
语言
C++
递交时间
2022-05-05 20:44:29
评测时间
2022-05-05 20:44:29
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes