제출 #1360432

#제출 시각아이디문제언어결과실행 시간메모리
1360432kawhietMonster-Go (EGOI25_monstergo)C++20
8 / 100
52 ms460 KiB
#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 47
#endif

mt19937 rng(time(0));

int f(int l, int r) {
    return rng() % (r - l + 1) + l;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    vector<vector<int>> a(4);
    int x = 0;
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 12; j++) {
            a[i].push_back(x++);
        }
    }
    int t = 100000;
    while (t--) {
        vector<int> x;
        for (int i = 0; i < 12; i++) {
            x.push_back(f(0, 49));
        }
        set<int> s(x.begin(), x.end());
        if (s.size() != 12) continue;
        bool ok = true;
        for (int i = 0; i < a.size(); i++) {
            for (int j = 0; j < 12; j++) {
                if (a[i][j] == x[j]) {
                    ok = false;
                    break;
                }
            }
        }
        if (ok) {
            a.push_back(x);
        }
    }
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (auto x : a[i]) {
            cout << x << ' ';
        }
        cout << '\n';
    }
    return 0;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…