# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1066786 | 2024-08-20T07:06:26 Z | 김은성(#11121) | Present (RMI21_present) | C++17 | 298 ms | 1480 KB |
#include <bits/stdc++.h> using namespace std; const int K = 20; vector<int> ans; int gcd(int a, int b){ if(b==0) return a; return gcd(b, a%b); } bool good(int mask){ int i, j; for(i=1; i<=K; i++){ for(j=1; j<=K; j++){ if((mask & (1<<(i-1))) && (mask & (1<<(j-1))) && !(mask & (1<<(gcd(i, j)-1)))) return false; } } return true; } void printset(int mask){ vector<int> ans; int i; for(i=1; i<=K; i++){ if((mask & (1<<(i-1)))) ans.push_back(i); } printf("%d ", ans.size()); for(int u: ans){ printf("%d ", u); } printf("\n"); } int main(){ int t, i; for(i=0; i<(1<<K); i++){ if(good(i)) ans.push_back(i); } //printf("ans.sz=%d\n", ans.size()); scanf("%d", &t); int k; while(t--){ scanf("%d", &k); printset(ans[k]); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 291 ms | 988 KB | Output is correct |
2 | Correct | 288 ms | 916 KB | Output is correct |
3 | Correct | 298 ms | 972 KB | Output is correct |
4 | Correct | 291 ms | 1052 KB | Output is correct |
5 | Correct | 289 ms | 856 KB | Output is correct |
6 | Correct | 297 ms | 996 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 291 ms | 988 KB | Output is correct |
2 | Correct | 288 ms | 916 KB | Output is correct |
3 | Correct | 298 ms | 972 KB | Output is correct |
4 | Correct | 291 ms | 1052 KB | Output is correct |
5 | Correct | 289 ms | 856 KB | Output is correct |
6 | Correct | 297 ms | 996 KB | Output is correct |
7 | Runtime error | 290 ms | 1480 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 291 ms | 988 KB | Output is correct |
2 | Correct | 288 ms | 916 KB | Output is correct |
3 | Correct | 298 ms | 972 KB | Output is correct |
4 | Correct | 291 ms | 1052 KB | Output is correct |
5 | Correct | 289 ms | 856 KB | Output is correct |
6 | Correct | 297 ms | 996 KB | Output is correct |
7 | Runtime error | 290 ms | 1480 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 291 ms | 988 KB | Output is correct |
2 | Correct | 288 ms | 916 KB | Output is correct |
3 | Correct | 298 ms | 972 KB | Output is correct |
4 | Correct | 291 ms | 1052 KB | Output is correct |
5 | Correct | 289 ms | 856 KB | Output is correct |
6 | Correct | 297 ms | 996 KB | Output is correct |
7 | Runtime error | 290 ms | 1480 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 291 ms | 988 KB | Output is correct |
2 | Correct | 288 ms | 916 KB | Output is correct |
3 | Correct | 298 ms | 972 KB | Output is correct |
4 | Correct | 291 ms | 1052 KB | Output is correct |
5 | Correct | 289 ms | 856 KB | Output is correct |
6 | Correct | 297 ms | 996 KB | Output is correct |
7 | Runtime error | 290 ms | 1480 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |