QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#490150#9156. 百万富翁Snowfall1462#15 627ms23384kbC++14750b2024-07-25 12:02:032024-07-25 12:02:03

Judging History

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

  • [2024-07-25 12:02:03]
  • 评测
  • 测评结果:15
  • 用时:627ms
  • 内存:23384kb
  • [2024-07-25 12:02:03]
  • 提交

answer

#include "richest.h"
#include <bits/stdc++.h>
using namespace std;
int richest(int N, int T, int S)
{
    if (N <= 1000)
    {
        vector<int> A, B, C;
        for (int i = 1; i < N; i++)
        {
            for (int j = 0; j < i; j++)
                A.emplace_back(i), B.emplace_back(j);
        }
        int fa[1010];
        memset(fa, 0, sizeof(fa));
        C = ask(A, B);
        for (int i = 0; i < A.size(); i++)
        {
            int x = A[i], y = B[i], z = C[i];
            if (z == x)
                fa[y] = x;
            else
                fa[x] = y;
        }
        for (int i = 0; i < N; i++)
        {
            if (!fa[i])
                return i;
        }
    }
    return 1;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 627ms
memory: 22844kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Wrong Answer
time: 13ms
memory: 23384kb

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: 616ms
memory: 22944kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 13ms
memory: 23308kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer