← All problemsSign in

Palindromes and Queries

CodeChefRating 3355Open on judge ↗

You are given a string $S$. Let the set of strings $ST$ be the set of all distinct contiguous [palindromic](https://en.wikipedia.org/wiki/Palindrome) substrings of $S$. Each element of $ST$ has a `value` associated with it which is initially 0. You need to process $Q$ queries which are of the following two types: - $1$ $L$ $R$ $P$ $X$: Add $X$ to the values of all palindromes that are substri

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