← All problemsSign in

Cache Hits

CodeChefRating 1320Open on judge ↗

Chef has a memory machine. It has one layer for data storage and another layer for cache. Chef has stored an array with length $N$ in the first layer; let's denote its elements by $A_0, A_1, \ldots, A_{N-1}$. Now he wants to load some elements of this array into the cache. The machine loads the array in blocks with size $B$: $A_0, A_1, \ldots, A_{B-1}$ form a block, $A_B, A_{B+1}, \ldots, A_{2B

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