QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#202784#5531. ICCCamillus#0 200ms4260kbC++201.6kb2023-10-06 13:25:142023-10-06 13:25:14

Judging History

你现在查看的是测评时间为 2023-10-06 13:25:14 的历史记录

  • [2024-07-01 04:28:34]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:205ms
  • 内存:4152kb
  • [2023-10-06 13:25:14]
  • 评测
  • 测评结果:0
  • 用时:200ms
  • 内存:4260kb
  • [2023-10-06 13:25:14]
  • 提交

answer

#include "bits/stdc++.h"
#include "icc.h"
using namespace std;

random_device rd;
mt19937 rnd(rd());

int rand(int n) {
    return rnd() % n;
}

int rand(int l, int r) {
    return l + rand(r - l + 1);
}

vector<int> low_half(vector<int> A) {
    int x = A.size() >> 1;
    return vector<int>(A.begin(), A.begin() + x);
}

vector<int> top_half(vector<int> A) {
    int x = A.size() >> 1;
    return vector<int>(A.begin() + x, A.end());
}

int query(vector<int> A, vector<int> B) {
    return query(A.size(), B.size(), A.data(), B.data());
}

void run(int n) {

    auto loop = [&]() {
        vector<int> a;
        vector<int> b;
        while (true) {
            a.clear();
            b.clear();

            vector<int> c(n);
            iota(c.begin(), c.end(), 1);
            a = low_half(c);
            b = top_half(c);

            if (query(a, b)) {
                break;
            }
        }

        int c1 = 0, c2 = 0;
        while (b.size() != 1) {
            if (query(a, low_half(b))) {
                b = low_half(b);
            } else {
                b = top_half(b);
            }
            c1++;
        }

        while (a.size() != 1) {
            if (query(low_half(a), b)) {
                a = low_half(a);
            } else {
                a = top_half(a);
            }
            c2++;
        }

        assert(max(c1, c2) <= 6);

        setRoad(a.front(), b.front());
    };

    for (int i = 0; i < n - 1; i++) {
        loop();
    }
}

#ifdef LOCAL
int main() {
    int n;
    cin >> n;
    run(n);
}
#endif

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Acceptable Answer

Test #1:

score: 0
Acceptable Answer
time: 0ms
memory: 4196kb

input:

1
1500 3
15

0
2

0.0
2.5

0
3.5

0

1 1

output:

0
Wrong road!

result:

points inf0

Subtask #2:

score: 0
Acceptable Answer

Test #3:

score: 0
Acceptable Answer
time: 1ms
memory: 4056kb

input:

1
2500 4
50

0
0

0.0
3.5

0
2.5

5

1 1

output:

0
Wrong road!

result:

points inf0

Subtask #3:

score: 0
Acceptable Answer

Test #6:

score: 0
Acceptable Answer
time: 200ms
memory: 4260kb

input:

1
2250 6
100

0.05
2.3

0.1
0.7

0
1.5

1.7

1.1 1

output:

0
Number of queries more than 4500 out of 2250

result:

points inf0

Subtask #4:

score: 0
Acceptable Answer

Test #10:

score: 0
Acceptable Answer
time: 177ms
memory: 4188kb

input:

1
2000 5
100

0.01
1.00

0.10
1.70

0.00
1.50

5.0

1.20 1

output:

0
Number of queries more than 4000 out of 2000

result:

points inf0

Subtask #5:

score: 0
Acceptable Answer

Test #14:

score: 0
Acceptable Answer
time: 157ms
memory: 4260kb

input:

1
1775 4
100

0.00
0.00

0.00
2.70

0.10
7.55

0.0

1.15 1

output:

0
Number of queries more than 3550 out of 1775

result:

points inf0

Subtask #6:

score: 0
Acceptable Answer

Test #20:

score: 0
Acceptable Answer
time: 144ms
memory: 4072kb

input:

1
1625 5
100

0.00
0.00

0.00
3.00

0.00
1.00

0.0

3 1

output:

0
Number of queries more than 3250 out of 1625

result:

points inf0