https://baike.baidu.com/item/模反元素/20417595 如果两个正整数a和n互质,那么一定可以找到整数b,使得 ab-1 被n整除,或者说ab被n除的余数是1.这时,b就叫做a的“模反元素” 中文名 模反元素 外文名modulo multiplicative inverse 同义词 模逆元素 如果两个正整数a和n互质,那么一定可以找到整数b,使得 ab-1 被n整除,或者说ab被n除的余数是1. 这时,b就叫做a对模数n的“模反元素”.比如,3和11互质,那么3的模…
https://en.wikipedia.org/wiki/Euler's_totient_function counts the positive integers up to a given integer n that are relatively prime to n. if two numbers m and n are relatively prime, then φ(mn) = φ(m) φ(n); https://zh.wikipedia.org/wiki/同餘 数学上,同余(英…
今天做了三道LeetCode上的简单题目,每道题都是用c++和Python两种语言写的.由于c++版的代码网上比較多.所以就仅仅分享一下Python的代码吧,刚学完Python的基本的语法,做做LeetCode的题目还是不错的,对以后找工作面试也有帮助! 刚開始就从AC率最高的入手吧! 1.Given an array of integers, every element appears twice except for one. Find that single one. Note: Your…
2021-10-14 P2577 [ZJOI2004]午餐 2021-10-13 CF815C Karen and Supermarket(小小紫题,可笑可笑) P6748 『MdOI R3』Fallen Lord(sort(a+1,a+1+n,greater<int>()); 真好用) P4161 [SCOI2009]游戏 P1707 刷题比赛 2021-10-12 CF1573A Countdown P2717 寒假作业 P7868 [COCI2015-2016#2] VUDU P1660…
Rsapaper.pdf http://people.csail.mit.edu/rivest/Rsapaper.pdf [概述Abstract 1.将字符串按照双方约定的规则转化为小于n的正整数m,可能分为多段,这不是关键: 2.加密过程同解密过程,都是取明/密文的public/private次方,然后对公共的n取余数: 3.整数转化为字符串 ] A message is encrypted by representing it as a number M, raising M to a pu…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6322 Problem Description In number theory, Euler's totient function φ(n) counts the positive integers up to a given integer n that are relatively prime to n . It can be defined more formally as the number…
GTW likes function 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5596 Description Now you are given two definitions as follows. f(x)=∑xk=0(−1)k22x−2kCk2x−k+1,f0(x)=f(x),fn(x)=f(fn−1(x))(n≥1) Note that φ(n) means Euler's totient function.(φ(n)is an…
题目链接: https://projecteuler.net/problem=516 题目: \(5\)-smooth numbers are numbers whose largest prime factor doesn't exceed \(5\). \(5\)-smooth numbers are also called Hamming numbers. Let S(L) be the sum of the numbers \(n\) not exceeding \(L\) such t…
Problem F. Grab The Tree Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 2004    Accepted Submission(s): 911 Problem Description Little Q and Little T are playing a game on a tree. There are …
题目链接: GTW likes function Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 131072/131072 K (Java/Others) Problem Description   Now you are given two definitions as follows. f(x)=∑xk=0(−1)k22x−2kCk2x−k+1,f0(x)=f(x),fn(x)=f(fn−1(x))(n≥1) Note th…