Submission #704908

# Submission time Handle Problem Language Result Execution time Memory
704908 2023-03-03T06:39:16 Z piOOE Super Dango Maker (JOI22_dango3) C++17
0 / 100
68 ms 536 KB
#include "dango3.h"

#include <bits/stdc++.h>

using namespace std;

mt19937 rnd(228);

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

    vector<int> ord(N);
    iota(ord.begin(), ord.end(), 1);

    shuffle(ord.begin(), ord.end(), rnd);

    set<int> st;

    while (!ord.empty()) {

        for (int x: ord) {
            st.insert(x);

            if (Query(vector(st.begin(), st.end())) == 1) {
                vector<int> stick{x};
                vector<int> consider(st.begin(), st.end());
                consider.erase(find(consider.begin(), consider.end(), x));

                set<int> save;

                for (int y: consider) {
                    st.erase(y);

                    if (stick.size() < n && Query(vector(st.begin(), st.end())) == 0) {
                        stick.push_back(y);
                        st.insert(y);
                    } else {
                        save.insert(y);
                    }
                }

                Answer(stick);

                vector<int> nxt;

                for (int z : ord) {
                    if (!st.count(z)) {
                        nxt.push_back(z);
                    }
                }

                swap(ord, nxt);
                shuffle(ord.begin(), ord.end(), rnd);
                break;
            }
        }
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:34:38: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   34 |                     if (stick.size() < n && Query(vector(st.begin(), st.end())) == 0) {
      |                         ~~~~~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 340 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 476 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 68 ms 536 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -