当前位置:网站首页>[PTA] l1-006 continuity factor
[PTA] l1-006 continuity factor
2022-04-23 20:23:00 【Maybe】
Original link
ac Code
Pay attention to the error prone points and optimization methods in the notes
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<map>
using namespace std;
int main() {
int n;
cin >> n;
int len = 0, st = 0;
for(int i = 2; i <= sqrt(n); i++) {
//sqrt(n) Then there can be no continuity factor
int temp = n;
if(!(temp % i)) {
int templ = 0, tempst = i;
int t = i;// Because it's a grouping factor , So it's possible to remove the front , Add the back , More cases of continuity factors , use t temporarily replace i
while(!(temp % t)) {
// Here, the continuous factor does not refer to the divisible factor used , But in groups
temp /= t++;
templ++;
}
if(templ > len) {
len = templ;
st = tempst;
}
}
}
if(len) {
cout << len << endl;
for(int i = st; i < st + len - 1; i++) {
cout << i << '*';
}
cout << st + len - 1;
}else{
cout << 1 << endl << n;// Prime cannot find intermediate factor , Previous searches will not record , Number of individual outputs 1 And it itself
}
return 0;
}
版权声明
本文为[Maybe]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232020000314.html
边栏推荐
- After route link navigation, the sub page does not display the navigation style problem
- Redis installation (centos7 command line installation)
- DNS cloud school rising posture! Three advanced uses of authoritative DNS
- WordPress plug-in: WP CHINA Yes solution to slow domestic access to the official website
- AQS learning
- JDBC tool class jdbcconutil gets the connection to the database
- 三十一. `prototype`显示原型属性和`__proto__`隐式原型属性
- 波场DAO新物种下场,USDD如何破局稳定币市场?
- Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
- The market share of the financial industry exceeds 50%, and zdns has built a solid foundation for the financial technology network
猜你喜欢
Computing the intersection of two planes in PCL point cloud processing (51)
AQS learning
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
Azkaban recompile, solve: could not connect to SMTP host: SMTP 163.com, port: 465 [January 10, 2022]
. Ren -- the intimate artifact in the field of vertical Recruitment!
How to protect ECs from hacker attacks?
DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
Automatically fill in body temperature and win10 task plan
Livego + ffmpeg + RTMP + flvjs to realize live video
DTMF dual tone multi frequency signal simulation demonstration system
随机推荐
NC basic usage 1
波场DAO新物种下场,USDD如何破局稳定币市场?
On BIM data redundancy theory
微信中金财富高端专区安全吗,证券如何开户呢
Cadence Orcad Capture 批量更改元件封装功能介绍图文教程及视频演示
Remote code execution in Win 11 using wpad / PAC and JScript
16MySQL之DCL 中 COMMIT和ROllBACK
Handwritten Google's first generation distributed computing framework MapReduce
如何做产品创新?——产品创新方法论探索一
三十.什么是vm和vc?
【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附matlab代码
Local call feign interface message 404
【PTA】L1-006 连续因子
NC basic usage 4
Es error: request contains unrecognized parameter [ignore_throttled]
【PTA】整除光棍
DTMF双音多频信号仿真演示系统
Five minutes to show you what JWT is
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
考研英语唐叔的语法课笔记