基础数论
文章平均质量分 59
StartDash
这个作者很懒,什么都没留下…
展开
-
LightOJ - 1356
素数+二分图二分图我不会暂时就不给代码了A set of integers is called prime independent if none of its member is a prime multiple of another member. An integera is said to be a prime multiple of b if,a = b x k原创 2017-07-04 09:12:37 · 523 阅读 · 0 评论 -
HDU 6129(找规律+杨辉三角)
Problem DescriptionThere is a nonnegative integer sequence a1...n of length n. HazelFan wants to do a type of transformation called prefix-XOR, which means a1...n changes into b1...n, wh原创 2017-09-07 17:02:50 · 275 阅读 · 0 评论 -
HDU 6169(数论+DP)
Problem DescriptionSenior Pan had just failed in his math exam, and he can only prepare to make up for it. So he began a daily task with Master Dong, Dong will give a simple math problem to poor原创 2017-09-07 09:36:18 · 354 阅读 · 0 评论 -
UVA - 11426
可以转化成求n以内gcd为1的,gcd为2的………gcd为n-1的i,j(i<j≤n)的对数,然后对数乘以相应的gcd即可然后gcd为k的i,j的对数为m=n/k以内的i,j互质的对数,即2以内与2互质的数的数目+3以内与3互质的数的数目+……+m以内与m互质的数的数目即欧拉函数值之和要注意的是 i 要小于 j ,即 i!=j ,所以要先令phi【1】=0再求和#include原创 2017-07-10 08:33:29 · 237 阅读 · 0 评论 -
LightOJ - 1220(n=b^k时最大的k,GCD)
Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactlyx days. Now RC-01 produces exactly p new deadly Bacteria wherex原创 2017-07-09 20:43:25 · 268 阅读 · 0 评论 -
LightOJ - 1138
You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you knowN! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the tr原创 2017-07-09 20:58:22 · 232 阅读 · 0 评论 -
LightOJ - 1234 (介绍一下欧拉常数,虽然没什么关系。。。)
In mathematics, the nth harmonic number is the sum of the reciprocals of the firstn natural numbers:In this problem, you are given n, you have to find Hn.Input Input starts with an integ原创 2017-07-09 19:47:26 · 620 阅读 · 0 评论 -
LightOJ - 1236质因子分解+LCM
Find the result of the following code:long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i n; i++ ) for( int j = i; j n; j++ ) if( lcm(i, j) ==原创 2017-07-09 19:27:57 · 363 阅读 · 0 评论 -
LightOJ - 1245
I was trying to solve problem '1234 - Harmonic Number', I wrote the following codelong long H( int n ) { long long res = 0; for( int i = 1; i n; i++ ) res = res + n / i; r原创 2017-07-09 19:17:31 · 270 阅读 · 0 评论 -
LightOJ - 1282(n^k的前三位数字和后三位数字)
You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.Input Input starts with an integer T (≤ 1000), denoti原创 2017-07-09 10:02:00 · 479 阅读 · 0 评论 -
LightOJ - 1341 合数分解
It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first mystery.Aladdin was about to enter to a magi原创 2017-07-09 09:30:20 · 260 阅读 · 0 评论 -
LightOJ - 1336 Sigma Function (n以内约数和为奇数(偶数)的数的个数)
Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For example σ(24) = 1+2+3+4原创 2017-07-06 09:20:06 · 375 阅读 · 0 评论 -
n的约数和
n=p1^e1*p2^e2*...*pn^en (pi为素数,ei为素数因子的个数)则:n的约数的个数: (e1+1)*(e2+1)*....*(en+1);n的约数和: (1+p1^1+...+p1^e1)*(1+p2^1+...+p2^e2)*...*(1+pn^1+...+pn^en);括号里的东西就用等比数列求和我就。。。随便写写。。。原创 2017-07-04 19:42:11 · 700 阅读 · 0 评论 -
HDU 6128(乱搞)
Problem DescriptionThere are n nonnegative integers a1…n which are less than p. HazelFan wants to know how many pairs i,j(1≤ij≤n) are there, satisfying 1ai+aj≡1ai+1aj when we calculate mod原创 2017-09-07 20:46:36 · 318 阅读 · 0 评论