QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#509952#9156. 百万富翁Littlelu0 92ms58600kbC++14762b2024-08-08 20:07:592024-08-08 20:07:59

Judging History

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

  • [2024-08-08 20:07:59]
  • 评测
  • 测评结果:0
  • 用时:92ms
  • 内存:58600kb
  • [2024-08-08 20:07:59]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
int t0(){
    int n=1000,m=0;
    vector<int> a,b,c,gr[1005],in(n+1),ord;
    queue<int> que;
    for(int i=1;i<=n;++i) for(int j=i+1;j<=n;++j) a.push_back(i),b.push_back(j),++m;
    c=ask(a,b);
    for(int i=0;i<m;++i){
        if(c[i]==a[i]) gr[b[i]].push_back(a[i]),in[a[i]]++;
        else gr[a[i]].push_back(b[i]),in[b[i]]++;
    }
    for(int i=1;i<=n;++i) if(in[i]==0) que.push(i);
    while(!que.empty()){
        int u=que.front();que.pop();
        ord.push_back(u);
        for(int v:gr[u]){
            in[v]--;
            if(in[v]==0) que.push(v);
        }
    }
    return *(ord.end()--);
}
int richest(int n,int t,int s){
    if(n==1000) return t0();
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 8ms
memory: 16000kb

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
Wrong Answer
time: 82ms
memory: 58496kb

input:

1000000 20 2000000 29091473

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer


Final Tests

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 15944kb

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
Wrong Answer
time: 92ms
memory: 58600kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer