随笔分类 - 数论
摘要:题目 通过题目条件,可以发现:一旦通过(n,k)->(nk,k)的操作来推出新的元组, n必定是k的倍数;而如果没有, 那么肯定是(xk+1,k)的形式。所以,推出第一条结论:只有在满足n=1,n是k的倍数,或者n-1是k的倍数时,(n,k)是传奇元组。 因此,我们可以认为(n,k)是传奇元组,当且
阅读全文
摘要:Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't
阅读全文
摘要:Let's introduce some definitions that will be needed later. Let prime(x)prime(x) be the set of prime divisors of xx. For example, prime(140)={2,5,7}pr
阅读全文
摘要:Ujan has been lazy lately, but now has decided to bring his yard to good shape. First, he decided to paint the path from his house to the gate. The pa
阅读全文
摘要:You are a rebel leader and you are planning to start a revolution in your country. But the evil Government found out about your plans and set your pun
阅读全文
摘要:Problem Statement Given is a string SS consisting of digits from 1 through 9. Find the number of pairs of integers (i,j)(i,j) (1≤i≤j≤|S|1≤i≤j≤|S|) tha
阅读全文
摘要:Today, Osama gave Fadi an integer XX, and Fadi was wondering about the minimum possible value of max(a,b)max(a,b) such that LCM(a,b)LCM(a,b) equals XX
阅读全文
摘要:Anu has created her own function ff: f(x,y)=(x|y)−yf(x,y)=(x|y)−y where || denotes the bitwise OR operation. For example, f(11,6)=(11|6)−6=15−6=9f(11,
阅读全文
摘要:Suppose you are performing the following algorithm. There is an array v1,v2,…,vnv1,v2,…,vn filled with zeroes at start. The following operation is app
阅读全文
摘要:For the multiset of positive integers s={s1,s2,…,sk}s={s1,s2,…,sk}, define the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of ss as
阅读全文
摘要:Every (positive) rational number can be expressed as a ratio of two (positive) integers.However, in decimal form, rational numbers often have an infin
阅读全文
摘要:To become the king of Codeforces, Kuroni has to solve the following problem. He is given nn numbers a1,a2,…,ana1,a2,…,an. Help Kuroni to calculate ∏1≤
阅读全文
摘要:It is Professor R's last class of his teaching career. Every time Professor R taught a class, he gave a special problem for the students to solve. You
阅读全文

浙公网安备 33010602011771号