2 条题解
-
-1
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; #define LL long long const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int a[N]; int main() { int n; cin >> n; int sum = 1; for(int i = 1 , x , y ; i <= n ; i++) { cin >> a[i]; y = sum; x = a[i]; sum *= x; while(y) { int t = x%y; x = y; y = t; } sum /= x; } for(int i = 1 ; i <= n ; i++) { cout << sum / a[i] << endl; } }
信息
- ID
- 997
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 3
- 标签
- 递交数
- 192
- 已通过
- 100
- 上传者