# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
857037 | 2023-10-05T09:25:42 Z | iulia_morariu | Present (RMI21_present) | C++17 | 1 ms | 604 KB |
#include <bits/stdc++.h> using namespace std; int cmmdc(int a, int b){ int c = 0; while(b > 0){ c = a % b; a = b; b = c; } return a; } bool concat_verif(vector<int> &a, int b){ bool ok = 1; for(int i = 0; i < a.size(); i++){ bool bun = 0; for(int j = 0; j <= i; j++){ if(cmmdc(b, a[i]) == a[j]){ bun = 1; break; } } if(!bun) return 0; } return 1; } int main(){ cin.tie(0);ios::sync_with_stdio(0); //1. vector <vector <int>> v(1); int t = 0; //2. cin >> t; //3. for(int i = 1; i <= 100; i++){ int s1 = v.size(); for(int j = 0; j < s1; j++){ if( concat_verif( v[j], i ) ){ vector <int> v1 = v[j]; v1.push_back(i); v.push_back( v1 ); } if(v.size() == 100) break; } if(v.size() == 100) break; } for(int ii = 0; ii < t; ii++){ int k; cin >> k; cout << v[k].size() << " "; for(int i = 0; i < v[k].size(); i++) cout << v[k][i] << " "; cout << endl; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 452 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 452 KB | Output is correct |
7 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 452 KB | Output is correct |
7 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 452 KB | Output is correct |
7 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 452 KB | Output is correct |
7 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |