답안 #1091868

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1091868 2024-09-22T11:46:42 Z _8_8_ Super Dango Maker (JOI22_dango3) C++17
100 / 100
1721 ms 860 KB
#include "dango3.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
    
int n, m;
const int N = 401;
bool bad[N * 26];
int B = -1, timer, vis[N * 26];
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
int qr(vector<int> &f) {
    vector<int> t;
    ++timer;
    for(int i:f) {
        vis[i] = timer;
    }
    for(int i = 1; i <= n * m; i++) {
        if(vis[i] != timer) {
            t.push_back(i);
        }
    }
    return m - Query(t);
}
vector<int> res[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);
    }
    shuffle(f.begin(), f.end(), rng);
    for(int i:f) {
        vector<int> o(m);
        iota(o.begin(), o.end(), 1);
        shuffle(o.begin(), o.end(), rng);
        for(int j:o) {
            if((int)res[j].size() == n) continue;
            res[j].push_back(i);
            if(qr(res[j]) <= 1) {
                break;
            }
            res[j].pop_back();
        }
    }
    for(int i = 1; i <= m; i++) {
        Answer(res[i]);
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 348 KB Output is correct
2 Correct 8 ms 348 KB Output is correct
3 Correct 8 ms 348 KB Output is correct
4 Correct 8 ms 348 KB Output is correct
5 Correct 8 ms 544 KB Output is correct
6 Correct 8 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 366 ms 600 KB Output is correct
2 Correct 354 ms 652 KB Output is correct
3 Correct 388 ms 600 KB Output is correct
4 Correct 385 ms 632 KB Output is correct
5 Correct 358 ms 656 KB Output is correct
6 Correct 359 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1513 ms 600 KB Output is correct
2 Correct 1564 ms 860 KB Output is correct
3 Correct 1721 ms 600 KB Output is correct
4 Correct 1641 ms 604 KB Output is correct
5 Correct 1520 ms 772 KB Output is correct
6 Correct 1506 ms 792 KB Output is correct