← All problemsSign in

Chef and the matrix queries

Chef has a (n x m) matrix. Initially the matrix elements have some values. You can perform 2 types of queries on the matrix. The two query types are as follows: 1. Query one is of the type - 1 x1 y1 x2 y2 k For this query you have to increment by k all the elements in the sub matrix that has its top left corner element row as x1 and column as y1 and the bottom right corner element row as x2 and

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