Submission #1089583

# Submission time Handle Problem Language Result Execution time Memory
1089583 2024-09-16T18:20:27 Z _8_8_ Super Dango Maker (JOI22_dango3) C++17
0 / 100
164 ms 868 KB
#include "dango3.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;

int n, m;
vector<int> get(vector<int> &a, vector<int> &b) {
    int lst = 0;
    vector<int> ret;
    for(int i = 0; i < m; i++) {
        int l = lst - 1, r = (int)a.size() - 1;
        while(r - l > 1) {
            int mid = (l + r) >> 1;
            vector<int> t = b;
            for(int j = lst; j <= mid; j++) {
                t.push_back(a[j]);
            }
            if(Query(t)) {
                r = mid;
            } else {
                l = mid; 
            }
        }
        lst = r + 1;
        ret.push_back(a[r]);
    }
    return ret;
}
const int N = 401;
vector<int> res[N];
int timer = 0, vis[N * 26];
void Solve(int _n, int _m) {
    n = _n, m = _m;
    vector<int> f, bf;
    for(int i = 1; i <= n * m; i++) {
        f.push_back(i);
    }
    for(int i = 0; i < n; i++) {
        timer++;
        vector<int> nv = get(f, bf);
        bf.push_back(nv[0]);
        for(int j = 0; j < m; j++) {
            // cout << nv[j] << ' ';
            res[j].push_back(nv[j]);
            vis[nv[j]] = timer;
        }
        // cout << '\n';
        vector<int> sw;
        for(int j:f) {
            if(vis[j] != timer) {
                sw.push_back(j);
            }
        }
        // for(int j:sw) {
        //     cout << j << ' ';
        // }
        // cout << '\n';
        f = sw;
    }
    for(int i = 0; i < m; i++) {
        Answer(res[i]);
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 348 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 47 ms 600 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 164 ms 868 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -