06 2022 档案
摘要:Paillier算法的原理和代码实现 密钥生成: 1、随机选择两个大质数p和q满足gcd(pq,(p-1)(q-1))=1。 这个属性是保证两个质数长度相等。 2、计算 n = pq和λ= lcm (p - 1,q-1)。 3、选择随机整数g使得gcd(L(glambda % n2) , n) =
阅读全文
摘要:leetcode-59题 leetcode-59题 参考代码随想录的中的解题思路 class Solution: def generateMatrix(self, n: int) -> List[List[int]]: x,y=0,0 loop=n//2 temp=1 matrix = [[0] *
阅读全文
摘要:self的使用,当创建了类的时候,要将self参数写入,在使用该函数的时候,需要先将其实例化才能使用 类方法需要使用self参数,而普通方法不需要self参数 1、self是指自己的意思,是指实例对象自己,也就是s1 = Student(‘张三’,80) 中的"s1"。 2、使用self的意义是把n
阅读全文
摘要:[Python技巧]是时候用 defaultdict 和 Counter 代替 dictionary 了 https://blog.csdn.net/lc013/article/details/91813812 参考自这篇csdn博客 Counter和defaultdict都是collections
阅读全文