![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
sigh_
这个作者很懒,什么都没留下…
展开
-
CodeForces_1461E Water Level(数论 + 贪心)
Water Leveltime limit per test:1 secondsmemory limit per test:256 megabytesProblem DescriptionIn recent years John has very successfully settled at his new job at the office. But John doesn’t like to idly sit around while his code is compiling, so he i原创 2020-12-12 16:07:34 · 437 阅读 · 1 评论 -
HDU_5381 The sum of gcd(数论+线段树)
The sum of gcdTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionYou have an array A,the length of AAA is nnnLet f(l,r)=∑i=lr∑j=ijgcd(ai,ai+1,...,aj)f(l,r)=\sum_{i=l}^r\sum_{j=i}^jgcd(a_i,a_{i+1},...,原创 2020-10-09 16:12:48 · 122 阅读 · 0 评论 -
CodeForces_920G List Of Integers(二分+容斥)
List Of Integerstime limit per test:5 secondsmemory limit per test:256 megabytesProblem DescriptionLet’s denote as L(x, p)L(x, p)L(x, p) an infinite sequence of integers yyy such that gcd(p, y) = 1gcd(p, y) = 1gcd(p, y) = 1 and y > xy > xy > x原创 2020-10-01 10:38:22 · 98 阅读 · 0 评论 -
HDU_5668 Circle(EXCRT)
CircleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionSatiya August is in charge of souls.He finds n souls,and lets them become a circle.He ordered them to play Joseph Games.The souls will count o原创 2020-09-17 12:00:46 · 77 阅读 · 1 评论 -
CodeForces_1139D Steps to One(数论)
Steps to Onetime limit per test:2 secondsmemory limit per test:256 megabytesProblem DescriptionVivek initially has an empty array a and some integer constant m.He performs the following algorithm:Select a random integer x uniformly in range from 1 t原创 2020-08-04 20:40:09 · 230 阅读 · 0 评论 -
洛谷_1445 樱花(数论)
樱花题目链接:https://www.luogu.com.cn/problem/P1445题解:1x+1y=1n!\frac{1}{x}+\frac{1}{y}=\frac{1}{n!}x1+y1=n!1=>x+yxy=1n!=> \frac{x+y}{xy}=\frac{1}{n!}=>xyx+y=n!1=>xy=x∗n!+y∗n!=> xy = x*n!+y*n!=>xy=x∗n!+y∗n!=>y(x−n!)=x∗n!=>y(x-n!原创 2020-06-12 18:27:26 · 169 阅读 · 0 评论 -
51nod_1793 吃汉堡(gcd+倍增)
吃汉堡Problem Description有n只汉堡,它们排成一行。第 i (1≤i≤n) 只汉堡有一个能量值 sis_isi 。现在要吃这些汉堡,为了使吃的过程更有趣味性,我们来制定一个规则:先选择两个数字 l 和 r (1≤l≤r≤n1≤l≤r≤n1≤l≤r≤n) 。对于每一对编号在l和r之间的汉堡作一个评估,当第i号和第j号作评估的时候,如果 sj%si=0s_j \% s_i = 0sj%si=0 那么第i号汉堡就得一分(当然,当 si%sj=0s_i \% s_j = 0si%s原创 2020-05-13 16:14:38 · 148 阅读 · 0 评论 -
CodeForces_1348D Phoenix and Science(数论)
Phoenix and Sciencetime limit per test:2 secondsmemory limit per test:256 megabytesProblem DescriptionPhoenix has decided to become a scientist! He is currently investigating the growth of bacteri...原创 2020-05-02 10:43:46 · 502 阅读 · 0 评论 -
CodeForces_1338C Perfect Triples(数论)
Perfect Triplestime limit per test:2 secondsmemory limit per test:256 megabytesProblem DescriptionConsider the infinite sequence s of positive integers, created by repeating the following steps:...原创 2020-04-13 14:25:03 · 237 阅读 · 0 评论 -
ZOJ_3224 Mathematics(数论)
MathematicsTime Limit: 1000 msMemory Limit: 32768 KBProblem DescriptionMathematics is always attractive. For example, Fourier Transform can split a normal function into parts with Sin function and...原创 2020-04-04 20:18:42 · 160 阅读 · 0 评论 -
51nod_1225 余数之和(分块)
余数之和Problem DescriptionF(n) = (n % 1) + (n % 2) + (n % 3) + … (n % n)。其中%表示Mod,也就是余数。例如F(6) = 6 % 1 + 6 % 2 + 6 % 3 + 6 % 4 + 6 % 5 + 6 % 6 = 0 + 0 + 0 + 2 + 1 + 0 = 3。给出n,计算F(n), 由于结果很大,输出Mod 100...原创 2020-03-29 12:45:30 · 190 阅读 · 0 评论 -
SGU_106 The equation(扩展欧几里得)
Ice-cream TycoonTime limit per test: 0.5 second(s)Memory limit: 65536 kilobytesProblem DescriptionInputOutputSample InputSample Output题意题解:原创 2020-03-23 11:19:51 · 148 阅读 · 0 评论 -
CodeForces_1234E Special Permutations(数论)
Special Permutationstime limit per test:2 secondsmemory limit per test:256 megabytesProblem DescriptionLet’s define pi(n)p_i(n)pi(n) as the following permutation: [i,1,2,…,i−1,i+1,…,n][i,1,2,…,i−...原创 2020-03-25 19:25:47 · 225 阅读 · 0 评论