Submission #704950

# Submission time Handle Problem Language Result Execution time Memory
704950 2023-03-03T07:10:51 Z piOOE Super Dango Maker (JOI22_dango3) C++17
22 / 100
1840 ms 516 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);

    deque<int> st(ord.begin(), ord.end());

    while (st.size() > n) {
        vector<int> now;
        int full = st.size() / n;

        while (now.size() < n) {
            int x = st.front();
            st.pop_front();

            if (Query(vector(st.begin(), st.end())) == full - 1) {
                now.push_back(x);
                continue;
            } else {
                st.push_back(x);
            }
        }

        Answer(now);
    }

    Answer(vector(st.begin(), st.end()));
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:18:22: warning: comparison of integer expressions of different signedness: 'std::deque<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |     while (st.size() > n) {
      |            ~~~~~~~~~~^~~
dango3.cpp:22:27: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   22 |         while (now.size() < n) {
      |                ~~~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 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 Correct 7 ms 388 KB Output is correct
2 Correct 11 ms 380 KB Output is correct
3 Correct 8 ms 340 KB Output is correct
4 Correct 10 ms 372 KB Output is correct
5 Correct 11 ms 380 KB Output is correct
6 Correct 11 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 298 ms 432 KB Output is correct
2 Correct 346 ms 424 KB Output is correct
3 Correct 343 ms 424 KB Output is correct
4 Correct 372 ms 420 KB Output is correct
5 Correct 358 ms 432 KB Output is correct
6 Correct 364 ms 460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1840 ms 516 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -