Submission #596830

# Submission time Handle Problem Language Result Execution time Memory
596830 2022-07-15T07:20:18 Z 박상훈(#8446) Super Dango Maker (JOI22_dango3) C++17
2 / 100
2808 ms 748 KB
#include "dango3.h"

#include <bits/stdc++.h>
using namespace std;

namespace {

int n, m;

}  // namespace

int my_query(vector<int> &V){
    vector<int> Q;
    int pt = 0;
    for (int i=1;i<=n*m;i++){
        if (pt<(int)V.size() && V[pt]==i){pt++; continue;}
        Q.push_back(i);
    }
    return m - Query(Q);
}

void dnc(vector<int> &V){
    assert(V.size()%m==0);
    int need = V.size() / m;
    if (need==1){
        Answer(V);
        return;
    }

    vector<int> V1, V2;
    for (auto &x:V){
        V1.push_back(x);
        if (my_query(V1) > need/2){
            V1.pop_back();
            V2.push_back(x);
        }
    }

    dnc(V1); dnc(V2);
}

void Solve(int N, int M) {
    n = N, m = M;

    vector<int> V;
    for (int i=1;i<=n*m;i++){
        V.push_back(i);
    }

    dnc(V);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 283 ms 508 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1408 ms 748 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2808 ms 684 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -