Sereja and Equality
Sereja call two arrays A and B with length n almost equal if for every i (1 . CX[x] equal to number of index j (1 such that X[j] . For two permutations P1 and P2 Sereja found new function F(P1, P2) that is equal to number of pairs (l,r) (1 such that P1[l..r] is almost equal to P2[l..r] and array P1[l..r] contain not more then E inversions. Now Sereja is insterested in next question: what is th
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