QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#527137#9156. 百万富翁sumi007#15 636ms33512kbC++14888b2024-08-22 10:43:562024-08-22 10:43:56

Judging History

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

  • [2024-08-22 10:43:56]
  • 评测
  • 测评结果:15
  • 用时:636ms
  • 内存:33512kb
  • [2024-08-22 10:43:56]
  • 提交

answer

#include "richest.h"
using namespace std;
#define pb push_back
int vis[2077][2077];
int richest(int N, int T, int S) {
    if(N==1000 && T==1 && S==499500){
        vector<int> a,b,c;
        for(int i=0;i<N;i++){
            for(int j=i+1;j<N;j++){
                a.pb(i),b.pb(j);
            }
        }
        c = ask(a,b);
        for(int i=0;i<c.size();i++){
            int u = a[i],v = b[i],w = c[i];
            if(u == w) vis[u][v] = 1,vis[v][u] = 0;
            else vis[u][v] = 0,vis[v][u] = 1;
        }
        int ans = 0;
        for(int i=0;i<N;i++){
            int ck = 1;
            for(int j=0;j<N;j++){
                if(i==j) continue;
                if(!vis[i][j]) ck = 0;
            }
            if(ck == 1){
                ans = i;
                break;
            }
        }
        return ans;
    }
    return 1;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 636ms
memory: 33512kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Wrong Answer
time: 14ms
memory: 24556kb

input:

1000000 20 2000000 29091473

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer


Final Tests

Test #1:

score: 15
Accepted
time: 635ms
memory: 33412kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 14ms
memory: 25012kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer