摘要:
【概述】 前缀和是一种及其优秀的线性结构,也是一种重要的思想,能极大的降低区间查询的时间复杂度。 前缀和又分为一维前缀和、二维前缀和,其与差分数组密切相关,关于差分数组:点击这里 【一维前缀和】 假设有一串长度为 n 的序列,再给出 m 次询问,每次询问给出 ... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(66)
评论(0)
推荐(0)
摘要:
【实现类】 const int maxSize=100;template class seqStack{public: seqStack(); ~seqStack(); void push(T x);//入栈 T pop();//出栈... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(56)
评论(0)
推荐(0)
摘要:
【实现类】 template struct Node{ T data; Node *next;};template class linkStack{public: linkStack(); ~linkStack(); void p... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(25)
评论(0)
推荐(0)
摘要:
【实现类】 const int maxSize=100;template class seqStack{public: seqStack(); ~seqStack(); void push(T x);//入栈 T pop();//出栈... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(41)
评论(0)
推荐(0)
摘要:
【概述】 栈(Stack)是一种特殊的线性表,只能在某一端插入和删除的特殊线性表。它按照后进先出的原则存储数据,先进入的数据被压入栈底,最后的数据在栈顶。 由于栈满足先进后出,后进先出的性质,因此也被称为先进后出表(FILO)或后进先出表(LIFO) 当栈中元... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(270)
评论(0)
推荐(0)
摘要:
这两天主要把之前的数论模版整理了一下,把没看的 BSGS 与扩展 BSGS 补上了,并且看了看之前没接触过的不定方程组,主要看了看毕达哥拉斯三元组与佩尔方程原理,明后天把这些模版整理一下 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(10)
评论(0)
推荐(0)
摘要:
Problem Description The latest reality show has hit the TV: ``Cat vs. Dog''. In this show, a bunch of cats and dogs compete for... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(20)
评论(0)
推荐(0)
摘要:
Problem Description Give you a matrix(only contains 0 or 1),every time you can select a row or a column and delete all the '1' ... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(25)
评论(0)
推荐(0)
摘要:
【概述】 BSGS(Baby Step Giant Step)算法,又称大小步算法,其主要用于解形如 的高次同余方程中的 x,其核心思想是分块。 当 A 与 C 互质时,通过费马小定理: 可知,当 时,会出现一个循环节,于是就能保证答案 x 若存在,必然有... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(73)
评论(0)
推荐(0)
摘要:
【理论】 快速求逆平方根:点击这里【例题】 1.公式推导 Answering Queries(LightOJ-1369)(公式推导):点击这里Applese 的减肥计划(2019牛客寒假算法基础集训营 Day4-J)(公式推导):点击这里处女座与线性代数(20... 阅读全文
posted @ 2022-09-20 22:57
老程序员111
阅读(6)
评论(0)
推荐(0)

浙公网安备 33010602011771号