2 條題解
-
3
#include <bits/stdc++.h> #define endl '\n' #define int long long using namespace std; int t, x; void solve() { cin >> x; for(int i = 2; i * i <= x; i++) { if(x % i == 0) { cout << i << " "; while(x % i == 0) { x /= i; } } } if(x != 1) { cout << x << " "; } cout << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(0); cin >> t; while(t--) { solve(); } }
資訊
- ID
- 1027
- 時間
- 1000ms
- 記憶體
- 256MiB
- 難度
- 9
- 标签
- 遞交數
- 348
- 已通過
- 27
- 上傳者