1096. Consecutive Factors (20)
来源:互联网 发布:linux远程连接xrdp 编辑:程序博客网 时间:2024/06/10 16:20
题目:https://www.patest.cn/contests/pat-a-practise/1096
代码:
#include<cstdio> #include<cstring> #include<cstdlib> #include<cmath>#include<algorithm> using namespace std; int main() { long long n,start=0,length=0;scanf("%lld",&n);for(long long i=2;i<=(long long)sqrt(n*1.0);i++){ long long temp=1,j=i; while(1){ temp*=j;if(n%temp!=0) break;if(j-i+1>length){ start=i; length=j-i+1; }j++; }}if(length==0){ printf("1\n%lld",n);}else{ printf("%lld\n",length); for(long long i=0;i<length;i++){ printf("%lld",start+i); if(i<length-1){ printf("*"); } }} system("pause"); }
0 0
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20)
- 比较lattice 的scaler 的 lanczos 和 双线性bilinear算法
- mysql 主键 索引
- js里删除某个元素
- spark集群安装和基本使用
- 学 Win32 汇编[28] - 跳转指令: JMP、JECXZ、JA、JB、JG、JL、JE、JZ、JS、JC、JO、JP 等
- 1096. Consecutive Factors (20)
- Git Community Book 中文版 rebase
- 剑指offer33
- shell脚本时间操作
- jdk不同版本对String拼接的优化分析
- do{...}while(0)的意义和用法
- 转-Memcache知识点梳理
- 2016年我所涉足的技术栈大盘点
- JNI学习