QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#528074#2809. Presentnhuang685#0 0ms0kbC++20897b2024-08-23 06:43:312024-08-23 06:43:31

Judging History

你现在查看的是最新测评结果

  • [2024-08-23 06:43:31]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [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%