Submission #521298

# Submission time Handle Problem Language Result Execution time Memory
521298 2022-02-01T14:20:24 Z qwerasdfzxcl Park (JOI17_park) C++14
0 / 100
30 ms 444 KB
#include "park.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
mt19937 seed(123456);
uniform_int_distribution<int> rng(0, 2147483647);

static int Place[1400];

int getrand(int l, int r){
    return rng(seed)%(r-l+1) + l;
}

void dnc(vector<int> A){
    if (A.size()<=1) return;
    memset(Place, 0, sizeof(Place));
    for (auto &x:A) Place[x] = 1;

    int idx = getrand(1, (int)A.size()-1);

    vector<int> nA = {A[0]}, nB = {A[idx]};
    Place[A[idx]] = 0;
    for (int i=1;i<(int)A.size();i++) if (i!=idx){
        if (Ask(A[0], A[i], Place)) nA.push_back(A[i]);
        else nB.push_back(A[i]);
    }

    for (auto &x:A) Place[x] = 0;
    Place[A[idx]] = 1;
    for (auto &x:nA){
        Place[x] = 1;
        if (Ask(x, A[idx], Place)){
            if (A[idx] < x) Answer(A[idx], x);
            else Answer(x, A[idx]);
        }
    }

    dnc(nA);
    dnc(nB);

}

void Detect(int T, int N) {
    vector<int> V;
    for (int i=0;i<N;i++) V.push_back(i);
    dnc(V);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Wrong Answer[2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 404 KB Wrong Answer[2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 428 KB Wrong Answer[4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 408 KB Wrong Answer[4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 444 KB Wrong Answer[4]
2 Halted 0 ms 0 KB -