随笔分类 -  数论-素数与整除问题

摘要:给你一个n个初始元素都为1的序列和m个询问q。 询问格式为:l r x(x为2or3) 最后求1~n所有数的GCD GCD:把每个数分别分解质因数,再把各数中的全部 公有质因数 提取出来连乘,所得的积就是这几个数的最大公约数。 include include include include incl 阅读全文
posted @ 2018-08-23 23:30 Roni_i 阅读(359) 评论(0) 推荐(0) 编辑
摘要:``` include include include include include include include include include include include include include include include include include include de 阅读全文
posted @ 2018-08-23 18:27 Roni_i 阅读(228) 评论(0) 推荐(0) 编辑
摘要:链接:https://www.nowcoder.com/acm/contest/121/F来源:牛客网 题目描述 WWX的女朋友送给了他一个礼物,可是礼物却被一把K进制密码锁锁住了。在礼物盒上还有一张出自她的女朋友的纸条:”嘿嘿~~密码我会在520那天告诉你”。但是WWX想提前知道礼物是什么,所以找 阅读全文
posted @ 2018-05-14 19:09 Roni_i 阅读(215) 评论(0) 推荐(0) 编辑
摘要:Mathematicians love all sorts of odd properties of numbers. For instance, they consider 945 to be an interesting number, since it is the first odd num 阅读全文
posted @ 2018-04-12 01:09 Roni_i 阅读(331) 评论(0) 推荐(0) 编辑
摘要:分解质因数: 1.保留重复 #include<stdio.h> #include<iostream> #include<string.h> #include<string> #include<ctype.h> #include<math.h> #include<set> #include<map> 阅读全文
posted @ 2018-04-10 22:47 Roni_i 阅读(198) 评论(0) 推荐(0) 编辑
摘要:不可摸数 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15591 Accepted Submission(s): 4077 Problem D 阅读全文
posted @ 2018-04-03 23:53 Roni_i 阅读(302) 评论(0) 推荐(0) 编辑
摘要:题目描述 为了把毕业晚会办得更好,老师想要挑出默契程度最大的k个人参与毕业晚会彩排。可是如何挑呢?老师列出全班同学的号数1,2,……,n,并且相信k个人的默契程度便是他们的最大公约数(这不是迷信哦~)。这可难为了他,请你帮帮忙吧! PS:一个数的最大公约数即本身。 输入输出格式 输入格式: 两个空格 阅读全文
posted @ 2018-03-14 20:49 Roni_i 阅读(370) 评论(0) 推荐(0) 编辑
摘要:题目描述 区间质数个数 输入输出格式 输入格式: 一行两个整数 询问次数n,范围m 接下来n行,每行两个整数 l,r 表示区间 输出格式: 对于每次询问输出个数 t,如l或r∉[1,m]输出 Crossing the line 输入输出样例 输入样例#1: 复制 2 5 1 3 2 6 输出样例#1 阅读全文
posted @ 2018-03-14 20:16 Roni_i 阅读(246) 评论(0) 推荐(0) 编辑
摘要:【链接】:https://www.luogu.org/problemnew/show/P1579 题目背景 1742年6月7日哥德巴赫写信给当时的大数学家欧拉,正式提出了以下的猜想:任何一个大于9的奇数都可以表示成3个质数之和。质数是指除了1和本身之外没有其他约数的数,如2和11都是质数,而6不是质 阅读全文
posted @ 2018-01-13 17:07 Roni_i 阅读(252) 评论(0) 推荐(0) 编辑
摘要:【唯一分解定理】:https://www.cnblogs.com/mjtcn/p/6743624.html 假设x是一个正整数,它的值不超过65535(即1<x<=65535),请编写一个程序,将x分解为若干个素数的乘积。 Input 输入的第一行含一个正整数k (1<=k<=10),表示测试例的个 阅读全文
posted @ 2017-12-10 00:48 Roni_i 阅读(286) 评论(0) 推荐(0) 编辑
摘要:A. Counterexample time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Counterexample time 阅读全文
posted @ 2017-12-09 16:32 Roni_i 阅读(269) 评论(0) 推荐(0) 编辑
摘要:时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld 题目描述 Forever97与未央是一对笔友,他们经常互相写信。有一天Forever97去邮局寄信,发现邮局的收费方式变成了按字收费,收取的费用为总字数除了 阅读全文
posted @ 2017-12-09 00:04 Roni_i 阅读(302) 评论(0) 推荐(0) 编辑
摘要:能被2、3、4、5、6、7、8、9 等数整除的数的特征 性质1:如果数a、b都能被c整除,那么它们的和(a+b)或差(a-b)也能被c整除。 性质2:几个数相乘,如果其中有一个因数能被某一个数整除,那么它们的积也能被这个数整除。 能被2整除的数,个位上的数能被2整除(偶数都能被2整除),那么这个数能 阅读全文
posted @ 2017-12-08 15:38 Roni_i 阅读(1929) 评论(0) 推荐(0) 编辑
摘要:A. Taymyr is calling you time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Comrade Dujikov 阅读全文
posted @ 2017-12-06 13:47 Roni_i 阅读(207) 评论(0) 推荐(0) 编辑
摘要:time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One way to create a task is to learn from 阅读全文
posted @ 2017-12-02 13:46 Roni_i 阅读(303) 评论(0) 推荐(0) 编辑
摘要:A. Lucky Division time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Lucky Division time 阅读全文
posted @ 2017-11-29 01:17 Roni_i 阅读(275) 评论(0) 推荐(0) 编辑
摘要:B. Beautiful Divisors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Recently Luba lear 阅读全文
posted @ 2017-11-24 12:15 Roni_i 阅读(261) 评论(0) 推荐(0) 编辑
摘要:1419 最小公倍数挑战 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注 1419 最小公倍数挑战 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 阅读全文
posted @ 2017-11-15 17:29 Roni_i 阅读(170) 评论(0) 推荐(0) 编辑
摘要:B. Divisiblity of Differences time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output B. Divisibl 阅读全文
posted @ 2017-10-17 00:01 Roni_i 阅读(374) 评论(0) 推荐(0) 编辑
摘要:C. Maximum splitting time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Maximum splittin 阅读全文
posted @ 2017-10-16 01:43 Roni_i 阅读(310) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示