QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#528074 | #2809. Present | nhuang685# | 0 | 0ms | 0kb | C++20 | 897b | 2024-08-23 06:43:31 | 2024-08-23 06:43:31 |
answer
#include <bits/stdc++.h>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
const int LG = 25;
std::vector<std::vector<int>> good;
for (int i = 0; i < (1 << LG); ++i) {
std::vector<int> ele;
for (int j = 0; j < LG; ++j) {
if (((1 << j) & i) != 0) {
ele.push_back(LG - j);
}
}
if (std::all_of(ele.begin(), ele.end(), [&](int v) {
return std::all_of(ele.begin(), ele.end(), [&](int v2) {
return ((1 << (LG - std::gcd(v, v2))) & i) != 0;
});
}))
{
good.push_back(ele);
}
}
std::sort(good.begin(), good.end());
int t;
std::cin >> t;
while ((t--) != 0) {
int k;
std::cin >> k;
std::cout << good[k].size();
for (int i : good[k] | std::views::reverse) {
std::cout << ' ' << i;
}
std::cout << '\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 0
Time Limit Exceeded
input:
5 62 37 88 57 72
output:
result:
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%