QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#152480#6521. Swapping Operationalch07Compile Error//C++142.5kb2023-08-28 09:48:252023-08-28 09:48:25

Details

answer.code: In function ‘int construct(int, int)’:
answer.code:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
answer.code: In function ‘void queryAnd(int, int, int, int, int)’:
answer.code:31:23: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
   31 |         return val[cur];
      |                ~~~~~~~^
answer.code:33:16: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
   33 |         return mx;
      |                ^~
answer.code:35:54: error: invalid operands of types ‘void’ and ‘void’ to binary ‘operator&’
   35 |         return queryAnd(lc[cur], l, (l+r)/2, fl, fr) & queryAnd(rc[cur], (l+r)/2+1, r, fl, fr);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                        |                                       |
      |                        void                                    void
answer.code: In function ‘void solve()’:
answer.code:50:27: error: void value not ignored as it ought to be
   50 |         pand[i] = queryAnd(root, 0, n-1, 0, i-1);
      |                   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
answer.code:53:27: error: void value not ignored as it ought to be
   53 |         sand[i] = queryAnd(root, 0, n-1, i, n-1);
      |                   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
answer.code:55:5: error: ‘vector’ was not declared in this scope
   55 |     vector <int> iPre;
      |     ^~~~~~
answer.code:2:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
answer.code:55:13: error: expected primary-expression before ‘int’
   55 |     vector <int> iPre;
      |             ^~~
answer.code:56:13: error: expected primary-expression before ‘int’
   56 |     vector <int> iSuf;
      |             ^~~
answer.code:59:13: error: ‘iPre’ was not declared in this scope
   59 |             iPre.push_back(i);
      |             ^~~~
answer.code:64:13: error: ‘iSuf’ was not declared in this scope
   64 |             iSuf.push_back(i);
      |             ^~~~
answer.code:71:53: error: invalid operands of types ‘void’ and ‘void’ to binary ‘operator+’
   71 |         ans = max(ans, queryAnd(root, 0, n-1, 0, i) + queryAnd(root, 0, n-1, i+1, n-1));
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                |                              |
      |                                void                           void
answer.code:75:24: error: ‘iPre’ was not declared in this scope
   75 |     for(int j = 0; j < iPre.size(); j++){
      |                        ^~~~
answer.code:76:28: error: ‘iSuf’ was not declared in this scope
   76 |         for(int k = 0; k < iSuf.size(); k++){
      |                            ^~~~
answer.code:83:43: error: ‘arr’ was not declared in this scope; did you mean ‘sarr’?
   83 |                     parr[i] = parr[i-1] & arr[i-1];
      |                                           ^~~
      |                                           sarr
answer.code:86:43: error: ‘arr’ was not declared in this scope; did you mean ‘sarr’?
   86 |                     sarr[i] = sarr[i+1] & arr[i];
      |                                           ^~~
      |                                           sarr
answer.code:95:24: error: ‘iPre’ was not declared in this scope
   95 |     for(int i = 0; i < iPre.size(); i++){
      |                        ^~~~