摘要:
Misha trains several ACM teams at the university. He is an experienced coach, and he does not underestimate the meaning of friendly and collaborative 阅读全文
摘要:
The hacker Michael develops breakthrough password manager, which is called KEK (Keeper of Encrypted Keys). A distinctive feature of KEK is excellent s 阅读全文
摘要:
There is a strip 1 × n with two sides. Each square of the strip (their total amount is 2n, n squares on each side) is painted in one of two colors (le 阅读全文
摘要:
FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line 阅读全文
摘要:
占位 阅读全文
摘要:
很久很久以前,在你刚刚学习字符串匹配的时候,有两个仅包含小写字母的字符串A和B,其中A串长度为m,B串长度为n。可当你现在再次碰到这两个串时,这两个串已经老化了,每个串都有不同程度的残缺。 你想对这两个串重新进行匹配,其中A为模板串,那么现在问题来了,请回答,对于B的每一个位置i,从这个位置开始连续 阅读全文
摘要:
把每一位看成ai*10^i,然后就是两个多项式相乘。利用FFT,把复杂度降到O(nlogn)。 阅读全文
摘要:
FFT在用于解决多项式乘法A*B(A和B为多项式,形如a0+a1*x^1+a2*x^2....)的时候,通俗地解释就是: 原理:先根据各自的系数各自转化为对应的向量(O(nlogn)),然后向量相乘(O(n)),最后再还原得到相乘后的系数(O(nlogn))。 手段:利用了虚数,使得可以分治来快速求 阅读全文
摘要:
You're given a sequence s of N distinct integers.Consider all the possible sums of three integers from the sequence at three different indicies.For ea 阅读全文
摘要:
思路:树状结构,改变权值其实是删一条边和加一条边,所以转化为LCT题。 优化:开始建树(原树,一共N条边,根为N+1)的时候,由于原树的虚拟的,我们不一定要把N条边都Link,而是可以直接记录fa即可。 当然还可以用分块做。但是没有LCT直观。 阅读全文