![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
Dejavu1z
做题,总结,不断的学习
展开
-
codeforces 1349A(数学)
题意描述思路题意要求求出gcd(lcm(ai,aj))∣i<jgcd(lcm(a_{i},a_{j})) | i<jgcd(lcm(ai,aj))∣i<j,由于lcm(ai,aj)=ai∗aj/gcd(ai,aj)lcm(a_{i},a_{j})=a_{i}*a_{j}/gcd(a_{i},a_{j})lcm(ai,aj)=ai∗aj/gcd(ai,aj),故得到式子gcd(ai∗aj/gcd(ai,aj))gcd(a_{i}*a_{j}/gcd(a_{i},a_{j原创 2020-10-15 19:54:43 · 179 阅读 · 0 评论 -
一些基础数论的知识和证明
算术基本定理N=pα1∗pα2∗...∗pαkN=p^{\alpha _{1}}*p^{\alpha _{2}}*...*p^{\alpha _{k}}N=pα1∗pα2∗...∗pαk约数个数(α1+1)∗(α2+1)...∗(αk+1)(\alpha _{1}+1)*(\alpha _{2}+1)...*(\alpha _{k}+1)(α1+1)∗(α2+1)...∗(αk+1)证明:已知N=pα1∗pα2∗...∗pαkN=p^{\alpha _{1}}*p^{\alpha _{原创 2020-10-07 17:38:26 · 620 阅读 · 4 评论 -
codeforces 1373C (数学)
题意描述给定一段伪代码,求程序结束后res的值res = 0for init = 0 to inf cur = init ok = true for i = 1 to |s| res = res + 1 if s[i] == '+' cur = cur + 1 else cur = cur - 1 if cur < 0 ok = fals原创 2020-07-31 16:15:46 · 299 阅读 · 0 评论 -
codeforces 628B(数学)
题意描述Max wants to buy a new skateboard. He has calculated the amount of money that is needed to buy a new skateboard. He left a calculator on the floor and went to ask some money from his parents. Meanwhile his little brother Yusuf came and started to pres原创 2020-07-23 15:15:01 · 148 阅读 · 0 评论 -
codeforces 1374D(数学)
题意描述You are given an array a consisting of n positive integers.Initially, you have an integer x=0. During one move, you can do one of the following two operations:Choose exactly one i from 1 to n and increase ai by x (ai:=ai+x), then increase x by 1 (x:原创 2020-07-08 15:13:56 · 377 阅读 · 0 评论 -
XXXXX codeforces1364A(数学)
题意描述Ehab loves number theory, but for some reason he hates the number x. Given an array a, find the length of its longest subarray such that the sum of its elements isn’t divisible by x, or determine that such subarray doesn’t exist.An array a is a subar原创 2020-07-08 15:10:34 · 287 阅读 · 0 评论 -
codeforce 650A (数学)
题意描述给你n对坐标,求出满足(x2−x1)2−(y2−y1)2\sqrt{\left ( x2-x1 \right )^{2}-\left ( y2-y1 \right )^{2}}(x2−x1)2−(y2−y1)2=∣x2−x1∣+∣y2−y1∣\left | x2-x1 \right |+\left | y2-y1 \right |∣x2−x1∣+∣y2−y1∣的数量。思路我们通过化简公式可以得到∣x2−x1∣+∣y2−y1∣+2(x2−x1)(y2−y1)=(x2−x1)2−(y2−y1)原创 2020-05-25 16:18:50 · 138 阅读 · 0 评论 -
codeforces 573A (数论)
题意描述Limak is an old brown bear. He often plays poker with his friends. Today they went to a casino. There are n players (including Limak himself) and right now all of them have bids on the table. i-th of them has bid with size a i dollars.Each player can原创 2020-05-22 17:40:25 · 218 阅读 · 0 评论 -
codeforce 1263C (整除分块)
题意描述给定你一个n,让你求出所有的n/i(下取整)思路这道题想了很久,打表发现了规律,每个的因子数都遵循2,33,44,555,666,7777,8888,99999…这种规律,但找到规律以后不知道该如何实现,看了题解以后才发现这是一道整数分块的问题。核心代码: int cnt=1; for(int l=1,r;l<=n;l=r+1){ r=n/(n/l); a[cnt++]=n/l; }AC原创 2020-05-10 22:39:46 · 271 阅读 · 0 评论 -
230B. T-primes (数论)
题意描述We know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we’ll call a positive integer t Т-prime, if t has exactly three distinct positive div...原创 2020-04-09 09:26:01 · 280 阅读 · 0 评论 -
HDOJ 1018(数论)
题意描述Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you ...原创 2020-03-17 13:43:00 · 170 阅读 · 0 评论