QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#509890#9156. 百万富翁Franuch#0 61ms19456kbC++17911b2024-08-08 19:30:382024-08-08 19:30:39

Judging History

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

  • [2024-08-08 19:30:39]
  • 评测
  • 测评结果:0
  • 用时:61ms
  • 内存:19456kb
  • [2024-08-08 19:30:38]
  • 提交

answer

#include "richest.h"
#include <bits/stdc++.h>

using namespace std;
typedef int ll;

ll on2(ll n) {
    vector<ll> a, b;
    for (ll i = 1; i < n; i++) {
        for (ll j = 0; j < i; j++) {
            a.push_back(i);
            b.push_back(j);
        }
    }

    vector<ll> c = ask(a, b);
    std::reverse(c.begin(), c.end());

    vector<vector<bool>> cmp(n, vector<bool>(n, true));
    for (ll i = 1; i < n; i++)
        for (ll j = 0; j < i; j++) {
            cmp[i][j] = c.back() == i;
            cmp[j][i] = c.back() == j;
        }

    for (ll i = 0; i < n; i++) {
        bool good = true;
        for (ll j = 0; j < n; j++)
            good = good and cmp[i][j];

        if (good)
            return i;
    }
    return 0;
}

ll richest(ll N, ll T, ll S) {
    if (N * (N - 1) / 2 <= S) {
        return on2(N);
    } else {
        return 2;
    }
}

详细


Pretests

Pretest #1:

score: 0
Wrong Answer
time: 61ms
memory: 19436kb

input:

1000 1 499500 957319859

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer

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: 58ms
memory: 19456kb

input:

1000 1 499500 957319857

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer

Test #2:

score: 0
Memory Limit Exceeded

input:

1000000 20 2000000 29091471

output:

Unauthorized output

result: