QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#492675#9156. 百万富翁posviiCompile Error//C++14579b2024-07-26 15:10:172024-07-26 15:10:17

Judging History

你现在查看的是最新测评结果

  • [2024-07-26 15:10:17]
  • 评测
  • [2024-07-26 15:10:17]
  • 提交

answer

#include "richest.h"
#include<bits/stdc++.h>
int _[1005][1005];
int richest(int n,int T,int S) {
    if(T==1) {
        vector<int> A,B;
        for(int i=0;i<n;++i) {
            for(int j=i+1;j<n;++j) {
                A.emplace_back(i),B.emplace_back(j);
            }
        }
        auto C=ask(A,B);
        for(int i=0,k=0;i<n;++i) {
            for(int j=i+1;j<n;++j) {
                _[i][j]=C[k++];
            }
        }
        int mx=0;
        for(int i=1;i<n;++i) {
            if(_[mx][i]==i) mx=i;
        }
        return mx;
    }
}

详细

answer.code: In function ‘int richest(int, int, int)’:
answer.code:6:9: error: ‘vector’ was not declared in this scope; did you mean ‘std::vector’?
    6 |         vector<int> A,B;
      |         ^~~~~~
      |         std::vector
In file included from /usr/include/c++/13/vector:66,
                 from richest.h:4,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_vector.h:425:11: note: ‘std::vector’ declared here
  425 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
answer.code:6:16: error: expected primary-expression before ‘int’
    6 |         vector<int> A,B;
      |                ^~~
answer.code:9:17: error: ‘A’ was not declared in this scope
    9 |                 A.emplace_back(i),B.emplace_back(j);
      |                 ^
answer.code:9:35: error: ‘B’ was not declared in this scope
    9 |                 A.emplace_back(i),B.emplace_back(j);
      |                                   ^
answer.code:12:20: error: ‘A’ was not declared in this scope
   12 |         auto C=ask(A,B);
      |                    ^
answer.code:12:22: error: ‘B’ was not declared in this scope
   12 |         auto C=ask(A,B);
      |                      ^
answer.code:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^