QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#547838#1955. Double Rainbowucup-team1005#Compile Error//C++20774b2024-09-05 10:55:552024-09-05 10:55:56

Details

answer.code: In function ‘int main()’:
answer.code:19:44: error: expected ‘;’ before ‘node’
   19 |     for (int i = 0; i < n; i++) cin >> a[i]
      |                                            ^
      |                                            ;
   20 |     node left, right;
      |     ~~~~                                    
answer.code:22:28: error: request for member ‘add’ in ‘std::right’, which is of non-class type ‘std::ios_base&(std::ios_base&)’
   22 |     for (auto i : a) right.add(i);
      |                            ^~~
answer.code:24:30: error: request for member ‘tot’ in ‘std::left’, which is of non-class type ‘std::ios_base&(std::ios_base&)’
   24 |         while (j < n && left.tot != k) right.del(a[j]), left.add(a[j]), j++;
      |                              ^~~
answer.code:24:46: error: request for member ‘del’ in ‘std::right’, which is of non-class type ‘std::ios_base&(std::ios_base&)’
   24 |         while (j < n && left.tot != k) right.del(a[j]), left.add(a[j]), j++;
      |                                              ^~~
answer.code:24:62: error: request for member ‘add’ in ‘std::left’, which is of non-class type ‘std::ios_base&(std::ios_base&)’
   24 |         while (j < n && left.tot != k) right.del(a[j]), left.add(a[j]), j++;
      |                                                              ^~~
answer.code:25:27: error: request for member ‘tot’ in ‘std::left’, which is of non-class type ‘std::ios_base&(std::ios_base&)’
   25 |         if (j < n && left.tot == k && right.tot == k) ans = min(ans, j - i);
      |                           ^~~
answer.code:25:45: error: request for member ‘tot’ in ‘std::right’, which is of non-class type ‘std::ios_base&(std::ios_base&)’
   25 |         if (j < n && left.tot == k && right.tot == k) ans = min(ans, j - i);
      |                                             ^~~
answer.code:26:15: error: request for member ‘add’ in ‘std::right’, which is of non-class type ‘std::ios_base&(std::ios_base&)’
   26 |         right.add(a[i]), left.del(a[i]);
      |               ^~~
answer.code:26:31: error: request for member ‘del’ in ‘std::left’, which is of non-class type ‘std::ios_base&(std::ios_base&)’
   26 |         right.add(a[i]), left.del(a[i]);
      |                               ^~~