K-Prob
CodeChefOpen on judge ↗
You are given a string $S$ of length $n$ and an integer $K$. We will define $F(L)$ here. Let's choose $K$ random sub-strings of length $L$ from $S$. Then $F(L)$ equals the probability such that all of them are pairwise identical. See the **Explanation** section for more clarity. You have to find $F(L)$ for each $1 \leq L \leq n$. It can be shown that any $F(L)$ can be expressed as a f
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start