QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#740537#9156. 百万富翁robertfan0 5ms15988kbC++141.1kb2024-11-13 10:20:592024-11-13 10:20:59

Judging History

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

  • [2024-11-13 10:20:59]
  • 评测
  • 测评结果:0
  • 用时:5ms
  • 内存:15988kb
  • [2024-11-13 10:20:59]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
int mp[8]={1,183,3472,20832,62500,125000,250000,500000};

int dfs(vector<int>all,int t,int s){
    if(all.size()==1){
        return all[0];
    }
    vector<int>num;
    int cnt=0;
    vector<int>ve;
    for(int i=0;i<all.size();i++){
        cnt++;
        num.push_back(all[i]);
        if(cnt==mp[t-1]){
            ve.push_back(dfs(num,t,s));
            num.clear();
            cnt=0;
        }
    }
    if(num.size()){
        ve.push_back(dfs(num,t-1,s));
    }
    int len=ve.size();
    if(len==1){
        return ve[0];
    }
    vector<int>a,b;
    for(int i=0;i<len;i++){
        for(int j=i+1;j<len;j++){
            a.push_back(ve[i]);
            b.push_back(ve[j]);
        }
    }
    vector<int>ok(len);
    vector<int>c=ask(a,b);
    for(int i=0;i<len;i++){
        ok[c[i]]++;
    }
    for(int i=0;i<len;i++){
        if(ok[i]==len-1){
            return ve[i];
        }
    }
    return 1;
}
int richest(int N,int T,int S){
    vector<int>all;
    for(int i=1;i<=N;i++){
        all.push_back(i);
    }
    return dfs(all,T,S);
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 4ms
memory: 15988kb

input:

1000 1 499500 957319859

output:

Index out of bounds
9775460264716263939
0.000000
6906350380861515327

result:

points 0.0 Index out of bounds

Pretest #2:

score: 0
Memory Limit Exceeded

input:

1000000 20 2000000 29091473

output:

Unauthorized output

result:



Final Tests

Test #1:

score: 0
Wrong Answer
time: 5ms
memory: 15920kb

input:

1000 1 499500 957319857

output:

Index out of bounds
9775460264716263939
0.000000
6906350380861515327

result:

points 0.0 Index out of bounds

Test #2:

score: 0
Memory Limit Exceeded

input:

1000000 20 2000000 29091471

output:

Unauthorized output

result: