← All problemsSign in

AP Free Sequences

CodeChefRating 1170Open on judge ↗

In a recent [breakthrough](https://www.quantamagazine.org/surprise-computer-science-proof-stuns-mathematicians-20230321/), sequences which do not have Arithmetic Progressions (APs) of size 3, were studied. Let us try a simple problem related to that. Consider a sequence $A_1 \leq A_2 \leq \ldots \leq A_n$. Three elements from it, say $A_i, A_j, A_k$, where $i < j < k$, are said to form an AP, if

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start