제출 #737037

#제출 시각아이디문제언어결과실행 시간메모리
737037mjhmjh1104Present (RMI21_present)C++17
0 / 100
4051 ms55924 KiB
#pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx,avx2,fma") #include <cstdio> #include <vector> #include <algorithm> using namespace std; int gcd(int x, int y) { return x % y ? gcd(y, x % y) : y; } bool validate(const vector<int> &v) { for (auto &i: v) for (auto &j: v) { int k = gcd(i, j); if (find(v.begin(), v.end(), k) == v.end()) return false; } return true; } int t, k; vector<vector<int>> lt; int main() { for (int i = 0; i < 1 << 25; i++) { vector<int> curr; for (int j = 24; j >= 0; j--) if (i & 1 << j) curr.push_back(j + 1); if (!validate(curr)) continue; lt.push_back(curr); } printf("%d\n", (int)lt.size()); sort(lt.begin(), lt.end()); for (scanf("%d", &t); t--; ) { scanf("%d", &k); auto &c = lt[k]; printf("%d ", (int)c.size()); for (int i = (int)c.size() - 1; i >= 0; i--) printf("%d ", c[i]); puts(""); } }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:35:15: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |     for (scanf("%d", &t); t--; ) {
      |          ~~~~~^~~~~~~~~~
Main.cpp:36:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |         scanf("%d", &k);
      |         ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...