【PAT】1096. Consecutive Factors
来源:互联网 发布:进销存数据库设计 编辑:程序博客网 时间:2024/05/01 18:52
#define LOCAL#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <string>using namespace std;typedef long long ll;bool isprime(int x){ for(int i=2;i*i<=x;i++){ if(x%i==0) return false; } if(x==0 || x==1) return false; else return true;}int main(){ #ifdef LOCAL freopen("data.in","r",stdin); freopen("data.out","w",stdout); #endif // LOCAL ll n; scanf("%lld",&n); ll sqr=(ll)sqrt(1.0*n),ans=0,len=0; for(ll i=2;i<=sqr;i++){ int alen=0; ll res=i; int d=i+1; while(n%res==0&&res<=n){ res*=d; d++;alen++; } if(alen>len){ ans=i;len=alen; } } if(len==0) printf("1\n%lld",n); else{ printf("%lld\n",len); for(ll i=0;i<len;i++){ printf("%lld",ans+i); if(i<len-1)printf("*"); } } return 0;}
0 0
- PAT 1096. Consecutive Factors
- PAT|1096. Consecutive Factors
- PAT--1096. Consecutive Factors
- 【PAT】1096. Consecutive Factors
- pat 1096. Consecutive Factors
- PAT 1096. Consecutive Factors (20)
- PAT 1096. Consecutive Factors (20)
- PAT 1096. Consecutive Factors (20)
- PAT 1096. Consecutive Factors (20)
- [PAT]1096. Consecutive Factors (20)
- 【PAT】1096. Consecutive Factors (20)
- PAT 1096. Consecutive Factors (20)
- PAT 1096. Consecutive Factors (20)
- PAT A 1096. Consecutive Factors (20)
- PAT(A) - 1096. Consecutive Factors (20)
- 1096. Consecutive Factors (20) PAT甲级
- PAT甲级.1096. Consecutive Factors (20)
- PAT-A 1096. Consecutive Factors (20)
- Java高并发,如何解决,什么方式解决
- 使用swoole实现生产者消费者模型(2)
- poj1751
- Android ADB命令的使用
- HDU1010 Tempter of the Bone (DFS & 奇偶剪枝)
- 【PAT】1096. Consecutive Factors
- android studio 自定义皮肤主题 ColorThemes
- MySQL中select * for update锁表的问题
- Android卸载测试应用后再次安装应用失败
- 软件管理 设备访问(初稿)
- 学习Cortex-M:结构体 vs 分散变量
- kruskal
- java中实现同步的两种方式:syschronized和lock的区别和联系
- 工作中碰到的那些坑(二)-安卓混合开发webview打开链接出错