Submission #785418

# Submission time Handle Problem Language Result Execution time Memory
785418 2023-07-17T09:01:59 Z JooDdae Super Dango Maker (JOI22_dango3) C++17
7 / 100
731 ms 588 KB
#include "dango3.h"

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

int cnt;
vector<int> type[400];

int query(vector<int> v) {
    for(int i=0;i<cnt;i++) for(int j=1;j<type[i].size();j++) v.push_back(type[i][j]);
    return Query(v);
}

void Solve(int N, int M) {
    vector<int> v(N*M);
    iota(v.begin(), v.end(), 1);

    random_device rd;
    shuffle(v.begin(), v.end(), mt19937(rd()));

    for(int i=0;i<N*M;i++) {
        int u = v.back(); v.pop_back();

        int re = query(v);
        
        if(re == M-1) {
            type[cnt++].push_back(u);
            continue;
        }

        for(int j=0;j<cnt;j++) {
            v.push_back(type[j][0]);
            int re = query(v);
            v.pop_back();

            if(re == M-1) {
                type[j].push_back(u);
                break;
            }
        }
    }


    type[N-1] = v;

    for(int i=0;i<M;i++) {
        vector<int> re;
        for(int j=0;j<N;j++) {
            re.push_back(type[j][i]);
        }
        Answer(re);
    }
}

Compilation message

dango3.cpp: In function 'int query(std::vector<int>)':
dango3.cpp:11:41: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i=0;i<cnt;i++) for(int j=1;j<type[i].size();j++) v.push_back(type[i][j]);
      |                                        ~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 312 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 91 ms 340 KB Output is correct
2 Correct 93 ms 400 KB Output is correct
3 Correct 91 ms 340 KB Output is correct
4 Correct 92 ms 340 KB Output is correct
5 Correct 102 ms 512 KB Output is correct
6 Correct 92 ms 388 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 351 ms 480 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 731 ms 588 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -