# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
869255 | MinaRagy06 | Present (RMI21_present) | C++17 | 2 ms | 604 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
const int N = 12;
vector<vector<int>> all;
bool check(vector<int> v) {
bool ok[N + 1]{};
for (auto i : v) ok[i] = 1;
for (int i = 0; i < v.size(); i++) {
for (int j = i + 1; j < v.size(); j++) {
if (!ok[gcd(v[i], v[j])]) return 0;
}
}
return 1;
}
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
for (int msk = 0; msk < (1 << N); msk++) {
vector<int> v;
for (int j = N - 1; j >= 0; j--) {
if ((msk >> j) & 1) v.push_back(j + 1);
}
if (check(v)) all.push_back(v);
}
sort(all.begin(), all.end());
int t;
cin >> t;
while (t--) {
int k;
cin >> k;
cout << all[k].size() << ' ';
for (int j = all[k].size() - 1; j >= 0; j--) {
cout << all[k][j] << ' ';
}
cout << '\n';
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |