java--study||O.o 摘要:参考代码:import java.util.Arrays; import java.util.Scanner; public class Main { public static voi…… 题解列表 2024年01月14日 0 点赞 0 评论 124 浏览 评分:9.9
质因数分解之暴力枚举 摘要:解题思路:枚举因数,比较取最大值注意事项:long long随意,枚举根号n即可参考代码:#include <iostream>#include <cmath>//不然用不了sqrt和max函数usi…… 题解列表 2024年02月02日 0 点赞 0 评论 137 浏览 评分:9.9
2518: 信息学奥赛一本通T1620-质因数分解 摘要:参考代码:import math n = int(input()) arr = [] for i in range(2, int(math.sqrt(n))+1): if n % i…… 题解列表 2024年03月18日 0 点赞 0 评论 108 浏览 评分:0.0
信息学奥赛一本通T1620-质因数分解 摘要:#include #include int isprime(int x) { int i=0; int t=sqrt(x); for(i=2;i…… 题解列表 2024年04月07日 0 点赞 0 评论 207 浏览 评分:8.0
2518: 信息学奥赛一本通T1620-质因数分解 摘要:解题思路: 从n到2,倒序判断k是为质数,若为质数,再判断 n%k == 0 同时判断 n//k是否也为质数,若都满足,则n为两个质数的积注意事项:题目的测试用例有问题,测试用例验证的:只是一个质数与…… 题解列表 2024年04月08日 0 点赞 0 评论 192 浏览 评分:0.0
2518: 信息学奥赛一本通T1620-质因数分解 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ long long n; cin>>n; …… 题解列表 2024年04月16日 0 点赞 0 评论 75 浏览 评分:0.0
虽然能通过不过我感觉输入一些数答案不是质数!!!例如输入50会输出25!!! 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,i,j; scanf("%d",&n); for(i=2;i<n;i++) …… 题解列表 2024年04月16日 0 点赞 0 评论 88 浏览 评分:0.0
打印较大的质因数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int n,i,j,max; scanf("%d",&n); …… 题解列表 2024年04月18日 0 点赞 0 评论 209 浏览 评分:0.0
2518: 信息学奥赛一本通T1620-质因数分解 摘要:解题思路:注意事项:参考代码:import mathdef is_qurt(n): flag = True for i in range(2,int(math.sqrt(n))+1): …… 题解列表 2024年07月31日 0 点赞 0 评论 129 浏览 评分:9.9
质因数分解 摘要:解题思路:注意事项:参考代码n=int(input())f=2while f*f<=n: if n %f==0: print(n//f) f+=1…… 题解列表 2024年08月10日 0 点赞 0 评论 104 浏览 评分:0.0