답안 #951819

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
951819 2024-03-22T17:32:20 Z EJIC_B_KEDAX Super Dango Maker (JOI22_dango3) C++17
22 / 100
133 ms 652 KB
#include <bits/stdc++.h>
#include "dango3.h"

using ll = long long;

using namespace std;

mt19937_64 mt(chrono::high_resolution_clock::now().time_since_epoch().count());

void Solve(int n, int m) {
    vector<int> have(n * m);
    for (int i = 0; i < n * m; i++) {
        have[i] = i + 1;
    }
    for (int _ = 0; _ < m; _++) {
        shuffle(have.begin(), have.end(), mt);
        vector<int> nw;
        for (int i = 0; i < n; i++) {
            nw.push_back(have[i]);
        }
        int ind = n;
        while (Query(nw) < 1) {
            nw.push_back(have[ind++]);
        }
        for (int i = 0; i < nw.size() && nw.size() > n; i++) {
            int tmp = nw[i];
            swap(nw[i], nw.back());
            nw.pop_back();
            if (!Query(nw)) {
                nw.push_back(tmp);
                swap(nw[i], nw.back());
            } else {
                i--;
            }
        }
        Answer(nw);
        unordered_set<int> st;
        vector<int> have2;
        for (int i : nw) {
            st.insert(i);
        }
        for (int i : have) {
            if (st.find(i) == st.end()) {
                have2.push_back(i);
            }
        }
        swap(have, have2);
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:25:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |         for (int i = 0; i < nw.size() && nw.size() > n; i++) {
      |                         ~~^~~~~~~~~~~
dango3.cpp:25:52: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   25 |         for (int i = 0; i < nw.size() && nw.size() > n; i++) {
      |                                          ~~~~~~~~~~^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 444 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Correct 3 ms 348 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 636 KB Output is correct
2 Correct 39 ms 600 KB Output is correct
3 Correct 36 ms 652 KB Output is correct
4 Correct 39 ms 644 KB Output is correct
5 Correct 36 ms 640 KB Output is correct
6 Correct 39 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 133 ms 600 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -