QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#740572#9156. 百万富翁robertfanCompile Error//C++14665b2024-11-13 10:33:462024-11-13 10:33:46

Judging History

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

  • [2024-11-13 10:33:46]
  • 评测
  • [2024-11-13 10:33:46]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
int mp[8]={1,183,3472,20832,62500,125000,250000,500000};
int ok[1000006];
int richest(int N,int T,int S){
    if(T==1){
        vector<int>a,b;
        for(int i=1;i<=N;i++){
            for(int j=i+1;j<=N;j++){
                a.push_back(i);
                b.push_back(j);
            }
        }
        memset(ok,0,sizeof(ok));
        c=ask(a,b);
        for(int i=1;i<=c.size();i++){
            ok[c[i]]++;
        }
        for(int i=1;i<=N;i++){
            if(ok[i]==N-1){
                return i;
            }
        }
    }
    memset(ok,0,sizeof(ok));
}

Details

answer.code: In function ‘int richest(int, int, int)’:
answer.code:16:9: error: ‘c’ was not declared in this scope
   16 |         c=ask(a,b);
      |         ^
answer.code:26:11: warning: control reaches end of non-void function [-Wreturn-type]
   26 |     memset(ok,0,sizeof(ok));
      |     ~~~~~~^~~~~~~~~~~~~~~~~