# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1150523 | marvinthang | 질문 (CEOI14_question_grader) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
const int K = 12;
vector <vector <bool>> a;
int decode(int n, int x, int y) {
if (a.empty()) {
a.emplace_back();
vector <bool> b(K);
iota(b.begin() + K / 2, b.end(), true);
do a.push_back(b); while (next_permutation(b.begin(), b.end()));
}
for (int i = 0; i < K; ++i) if (a[x][i] && !a[y][i]) return i + 1;
}
#include <bits/stdc++.h>
using namespace std;
const int K = 12;
vector <vector <bool>> a;
int decode(int n, int x, int y) {
if (a.empty()) {
a.emplace_back();
vector <bool> b(K);
iota(b.begin() + K / 2, b.end(), true);
do a.push_back(b); while (next_permutation(b.begin(), b.end()));
}
for (int i = 0; i < K; ++i) if (a[x][i] && !a[y][i]) return i + 1;
}