
素数相关
小雪乃
这个作者很懒,什么都没留下…
展开
-
PAT 甲级 1059. Prime Factors (25)
Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1 * p2^k2 *…*pm^km. Input Specification: Each input file contains one test c原创 2017-10-01 17:13:16 · 189 阅读 · 0 评论 -
蓝桥杯 算法提高 8-1因式分解
问题描述 设计算法,用户输入合数,程序输出若个素数的乘积。例如,输入6,输出2*3。输入20,输出2*2*5。 样例 与上面的样例输入对应的输出。 例:数据规模和约定 输入数据中每一个数在int表示范围内。#include <iostream> #include <vector> #include <string> #include <queue> using namesp原创 2017-12-10 13:55:48 · 230 阅读 · 0 评论 -
蓝桥杯 算法训练 Torry的困惑(基本型)
问题描述 Torry从小喜爱数学。一天,老师告诉他,像2、3、5、7……这样的数叫做质数。Torry突然想到一个问题,前10、100、1000、10000……个质数的乘积是多少呢?他把这个问题告诉老师。老师愣住了,一时回答不出来。于是Torry求助于会编程的你,请你算出前n个质数的乘积。不过,考虑到你才接触编程不久,Torry只要你算出这个数模上50000的值。 输入格式 仅包含一个正原创 2017-12-11 17:25:25 · 235 阅读 · 0 评论