记录详情

Compile Error

foo.cc: In member function ‘BigInt BigInt::operator+(const BigInt&) const’:
foo.cc:31:1: error: expected primary-expression before ‘|’ token
   31 | | j >= 0 |
      | ^
foo.cc:32:1: error: expected primary-expression before ‘|’ token
   32 | | carry != 0) {
      | ^
foo.cc: In member function ‘BigInt BigInt::operator*(const BigInt&) const’:
foo.cc:55:9: error: ‘vector’ was not declared in this scope
   55 |         vector<int> res(len, 0);
      |         ^~~~~~
foo.cc:4:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | 
foo.cc:55:16: error: expected primary-expression before ‘int’
   55 |         vector<int> res(len, 0);
      |                ^~~
foo.cc:60:27: error: ‘res’ was not declared in this scope
   60 |                 int sum = res[i + j + 1] + mul;
      |                           ^~~
foo.cc:66:16: error: ‘res’ was not declared in this scope
   66 |         while (res[0] == 0 && res.size() > 1) {
      |                ^~~
foo.cc:71:22: error: ‘res’ was not declared in this scope
   71 |         for (int i : res) {
      |                      ^~~
foo.cc:54:13: warning: unused variable ‘len’ [-Wunused-variable]
   54 |         int len = len1 + len2;
      |             ^~~

信息

递交者
类型
自测
语言
C++
递交时间
2024-05-05 11:23:47
评测时间
2024-05-05 11:23:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes