洛谷 P3369 【模板】普通平衡树 (Treap)
SPOJ MAXMATCH - Maximum Self-Matching (FFT)
题目链接:MAXMATCH - Maximum Self-Matching
Description
You’re given a string s consisting of letters ‘a’, ‘b’ and ‘c’.
The matching function $m_s( i )$ is defined as the number of matching characters of s and its i-shift. In other words, $m_s( i )$ is the number of characters that are matched when you align the 0-th character of s with the i-th character of its copy.
You are asked to compute the maximum of $m_s( i )$ for all i ( 1 <= i <= |s| ). To make it a bit harder, you should also output all the optimal i’s in increasing order.
洛谷 P4173 残缺的字符串 (FFT)
Codeforces 993E Nikita and Order Statistics (FFT)
Codeforces Round #488 by NEAR (Div. 1)
题目链接:
CF993E Nikita and Order Statistics
Nikita likes tasks on order statistics, for example, he can easily find the $k$-th number in increasing order on a segment of an array. But now Nikita wonders how many segments of an array there are such that a given number $x$ is the $k$-th number in increasing order on this segment. In other words, you should find the number of segments of a given array such that there are exactly $k$ numbers of this segment which are less than $x$.
Nikita wants to get answer for this question for each $k$ from $0$ to $n$, where $n$ is the size of the array.
洛谷 P2756 飞行员配对方案问题 (二分图匹配)
HDU 1879 继续畅通工程 (最小生成树)
POJ 3090 Visible Lattice Points (欧拉函数)
题目链接:POJ 3090
Description
A lattice point $(x, y)$ in the first quadrant ($x$ and $y$ are integers greater than or equal to $0$), other than the origin, is visible from the origin if the line from $(0, 0)$ to $(x, y)$ does not pass through any other lattice point. For example, the point $(4, 2)$ is not visible since the line from the origin passes through $(2, 1)$. The figure below shows the points $(x, y)$ with $0 \le x, y \le 5$ with lines from the origin to the visible points.
Write a program which, given a value for the size, $N$, computes the number of visible points $(x, y)$ with $0 \le x, y \le N$.