国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

1096. Consecutive Factors (20)

2019-11-10 23:30:23
字體:
供稿:網(wǎng)友

Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3*5*6*7, where 5, 6, and 7 are the three consecutive numbers. Now given any positive N, you are supposed to find the maximum number of consecutive factors, and list the smallest sequence of the consecutive factors.

Input Specification:

Each input file contains one test case, which gives the integer N (1

#include<cstdio>#include<cmath>typedef long long ll;int main(){ ll n; scanf("%lld",&n); ll a=(ll)sqrt(n); int ansI=0,ansLen=0; for(int i=2;i<=a;i++){ int j=i; ll temp=1; while(1){ temp*=j; if(n%temp!=0) break; if(ansLen<j-i+1){ ansI=i; ansLen=j-i+1; } j++; } } if(ansLen==0){
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 清水县| 松滋市| 五华县| 望城县| 利辛县| 喀什市| 西平县| 武威市| 曲麻莱县| 瑞昌市| 万年县| 景德镇市| 云安县| 黎川县| 锡林郭勒盟| 凌源市| 林口县| 高阳县| 玉溪市| 吉林市| 祁阳县| 隆德县| 缙云县| 花垣县| 板桥市| 论坛| 克什克腾旗| 内乡县| 蕉岭县| 璧山县| 梁平县| 宜川县| 湟中县| 区。| 阳谷县| 岱山县| 吉安县| 通渭县| 花莲县| 个旧市| 海南省|