![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
sigh_
这个作者很懒,什么都没留下…
展开
-
CodeForces_1461E Water Level(数论 + 贪心)
Water Level time limit per test:1 seconds memory limit per test:256 megabytes Problem Description In 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 · 442 阅读 · 1 评论 -
HDU_5381 The sum of gcd(数论+线段树)
The sum of gcd Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description You have an array A,the length of AAA is nnn Let 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 · 123 阅读 · 0 评论 -
CodeForces_920G List Of Integers(二分+容斥)
List Of Integers time limit per test:5 seconds memory limit per test:256 megabytes Problem Description Let’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 · 103 阅读 · 0 评论 -
HDU_5668 Circle(EXCRT)
Circle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description Satiya 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 · 78 阅读 · 1 评论 -
CodeForces_1139D Steps to One(数论)
Steps to One time limit per test:2 seconds memory limit per test:256 megabytes Problem Description Vivek 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 · 232 阅读 · 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 · 171 阅读 · 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 Science time limit per test:2 seconds memory limit per test:256 megabytes Problem Description Phoenix has decided to become a scientist! He is currently investigating the growth of bacteri...原创 2020-05-02 10:43:46 · 505 阅读 · 0 评论 -
CodeForces_1338C Perfect Triples(数论)
Perfect Triples time limit per test:2 seconds memory limit per test:256 megabytes Problem Description Consider the infinite sequence s of positive integers, created by repeating the following steps: ...原创 2020-04-13 14:25:03 · 238 阅读 · 0 评论 -
ZOJ_3224 Mathematics(数论)
Mathematics Time Limit: 1000 ms Memory Limit: 32768 KB Problem Description Mathematics is always attractive. For example, Fourier Transform can split a normal function into parts with Sin function and...原创 2020-04-04 20:18:42 · 161 阅读 · 0 评论 -
51nod_1225 余数之和(分块)
余数之和 Problem Description F(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 · 191 阅读 · 0 评论 -
SGU_106 The equation(扩展欧几里得)
Ice-cream Tycoon Time limit per test: 0.5 second(s) Memory limit: 65536 kilobytes Problem Description Input Output Sample Input Sample Output 题意 题解:原创 2020-03-23 11:19:51 · 151 阅读 · 0 评论 -
CodeForces_1234E Special Permutations(数论)
Special Permutations time limit per test:2 seconds memory limit per test:256 megabytes Problem Description Let’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 · 228 阅读 · 0 评论