- 博客(5)
- 收藏
- 关注
原创 Joseph‘s Problem(UVA 1363)
数论学习笔记Joseph’s Problem(UVA 1363)题意:输入正整数n和k(1<=n,k<=1e9),计算 ∑i=1n\sum_{i=1}^n∑i=1nk mod i。思路:先把k%i == k的部分处理掉,然后就变成了只剩下对k>n的情况。假设k/i的整数部分为p,因为k/(i+1)和k/i的整数部分差别不大,当k/(i+1)的整数部分也为p的时候:k%(i+1) = k-(i+1)p = k-ip-p = k%i - p也就是说,当p相同时,对于连续的区间
2021-04-25 16:46:45 117
原创 树状数组入门+例题Ping Pong
树状数组入门对于给定的包含n个元素的数组A,查询(L,R)间Ai的和,我们可以暴力查找,每一次查询将花费O(n)的代价,效率太低。我们会想到前缀和的方法,做预处理求出sum[i] (a1+a2+…+ai),让查询的复杂度降低为O(1)。但是,如果我们要对单点进行修改,我们将花费O(n)的代价。那么怎么让我们的查询和更新的效率都变得更高呢(相对于暴力查找)?树状数组可以将查询和更新的复杂度都降为O...
2019-04-19 11:33:52 245
原创 Secret-key Crytography
Secret-key CrytographyThe scientific development phase of cryptography begins with the presentation of symmetric keys.Secret-key Crytography starts with Shannon’s paper——《Communication theory of secr...
2019-04-13 22:09:13 321
原创 Summary of Classical Cryptography
Summary of Classical CryptographyWith the emergence and development of computers, information security has graduallybecome a concern of people. In these courses, I learned about the framework of cry...
2019-04-13 21:55:23 269
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人