← All problemsSign in

Pishty and Triangles

CodeChefRating 2261Open on judge ↗

Pishty is a little boy who lives in Khust, an ancient town with a castle and smart bears. Right now, he wants you to help him with a programming problem. You are given a sequence A1, A2, ..., AN and Q queries. There are two types of queries: - 1 pos val — Set Apos = val. - 2 l r — Find the maximum possible perimeter of a triangle with non-zero area whose sides are elements of the subsequence

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