제출 #704904

#제출 시각아이디문제언어결과실행 시간메모리
704904piOOESuper Dango Maker (JOI22_dango3)C++17
22 / 100
1639 ms740 KiB
#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;

    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);

            swap(st, save);
        }
    }
}

컴파일 시 표준 에러 (stderr) 메시지

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:32:34: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   32 |                 if (stick.size() < n && Query(vector(st.begin(), st.end())) == 0) {
      |                     ~~~~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...