摘要:
Problems # Name A Boboniu Likes to Color Ballsstandard input/output1 s, 256 MB x9516 B Boboniu Plays Chessstandard input/output1 s, 512 MB x8169 C Bob 阅读全文
摘要:
link Problems # Name A Suborrays B Fix You C Cyclic Permutations D 505 E Pairs of Pairs Solution A #include<set> #include<map> #include<ctime> #includ 阅读全文
摘要:
一道 树状数组套权值线段数的模板题。(然而我刚开始用线段树套平衡树做了) (orz hzwer) 题意 给定一个含有 n 个数的序列 \(a_1,a_2 \dots a_n\),需要支持两种操作: Q l r k 表示查询下标在区间$ [l,r]$中的第 k 小的数 C x y 表示将 \(a_x\ 阅读全文
摘要:
快速幂顾名思义,就是快速算某个数的多少次幂。 其时间复杂度为O(log₂N),与朴素的O(N)相比效率有了极大的提高。 核心思想就是 如果$k$是偶数 那么 \(x^ k =(x^{2})^{\tfrac{k}{2}}\) 如果$k$是奇数 那么 \(x ^ k = x * x ^{ ( k - 1 阅读全文