답안 #871602

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
871602 2023-11-11T07:24:47 Z TAhmed33 Present (RMI21_present) C++
8 / 100
37 ms 1608 KB
#include <bits/stdc++.h>
using namespace std;
vector <vector <int>> dd;
const int n = 15;
int main () {
	for (int i = 0; i < (1 << n); i++) {
		vector <int> x;
		int freq[n + 1] = {};
		for (int j = 0; j < n; j++) {
			if ((i >> j) & 1) {
				freq[j + 1] = 1;
				x.push_back(j + 1);
			}
		}
		bool flag = 0;
		for (int i = 0; i < n; i++) for (int j = 1; j < n; j++) {
			if (freq[i + 1] && freq[j + 1]) flag |= !freq[__gcd(i + 1, j + 1)];
		}
		if (flag) continue;
		reverse(x.begin(), x.end());
		dd.push_back(x);
	}
	sort(dd.begin(), dd.end());
	int t;
	cin >> t;
	while (t--) {
		int k;
		cin >> k; 
		cout << dd[k].size() << " ";
		reverse(dd[k].begin(), dd[k].end());
		for (auto j : dd[k]) cout << j << " ";
		cout << '\n';
		reverse(dd[k].begin(), dd[k].end());
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 872 KB Output is correct
2 Correct 33 ms 604 KB Output is correct
3 Correct 33 ms 604 KB Output is correct
4 Correct 33 ms 832 KB Output is correct
5 Correct 33 ms 832 KB Output is correct
6 Correct 33 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 872 KB Output is correct
2 Correct 33 ms 604 KB Output is correct
3 Correct 33 ms 604 KB Output is correct
4 Correct 33 ms 832 KB Output is correct
5 Correct 33 ms 832 KB Output is correct
6 Correct 33 ms 600 KB Output is correct
7 Runtime error 34 ms 1608 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 872 KB Output is correct
2 Correct 33 ms 604 KB Output is correct
3 Correct 33 ms 604 KB Output is correct
4 Correct 33 ms 832 KB Output is correct
5 Correct 33 ms 832 KB Output is correct
6 Correct 33 ms 600 KB Output is correct
7 Runtime error 34 ms 1608 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 872 KB Output is correct
2 Correct 33 ms 604 KB Output is correct
3 Correct 33 ms 604 KB Output is correct
4 Correct 33 ms 832 KB Output is correct
5 Correct 33 ms 832 KB Output is correct
6 Correct 33 ms 600 KB Output is correct
7 Runtime error 34 ms 1608 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 872 KB Output is correct
2 Correct 33 ms 604 KB Output is correct
3 Correct 33 ms 604 KB Output is correct
4 Correct 33 ms 832 KB Output is correct
5 Correct 33 ms 832 KB Output is correct
6 Correct 33 ms 600 KB Output is correct
7 Runtime error 34 ms 1608 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -