hdu-1019 Least Common Multiple
来源:互联网 发布:伯恩数据统计表格模板 编辑:程序博客网 时间:2024/06/05 17:33
#include<stdio.h>int gcd(int a,int b){ return b?gcd(b,a%b):a;}int main(){ int n,t,i,m,k; int a[100000]; scanf("%d",&n); while(n--) { scanf("%d",&m); if(m==1) { scanf("%d",&t); printf("%d\n",t); continue; } for(i=1;i<=m;i++) scanf("%d",&a[i]); k=a[2]/gcd(a[1],a[2])*a[1]; for(i=3;i<=m;i++) //注意当输入的数的个数为一的时候 k=a[i]/gcd(a[i],k)*k; printf("%d\n",k); } return 0;}
0 0
- HDU 1019 Least Common Multiple
- hdu 1019 Least Common Multiple
- HDU-1019 least common multiple
- HDU 1019 Least Common Multiple
- HDU 1019 Least Common Multiple
- HDU 1019 Least Common Multiple
- HDU 1019 Least Common Multiple
- hdu 1019Least Common Multiple
- hdu 1019 Least Common Multiple
- hdu 1019 Least Common Multiple
- Hdu 1019 Least Common Multiple
- hdu 1019 Least Common Multiple
- HDU 1019Least Common Multiple
- hdu 1019 Least Common Multiple
- hdu 1019 Least Common Multiple
- hdu 1019 Least Common Multiple
- HDU 1019 Least Common Multiple
- hdu 1019 Least Common Multiple
- Android 可拖拽的GridView效果实现, 长按可拖拽和item实时交换位置
- 文章标题
- java--GUI程序设计中的布局
- hdu-1256 画8
- 转: 互联网下,各种高性能后端系统,技术解决方案
- hdu-1019 Least Common Multiple
- layoutSubviews总结
- Mac与Phy组成原理的简单分析
- 关于android性能,内存优化
- hdu-1029 Ignatius and the Princess IV
- c#securityexception不允许所请求的注册表访问权
- OSPF实验一
- js代码判断浏览器类型
- hdu-1037 Keep on Truckin'