Skip to main content

Practice · 3 of 6

Contest 1 — Problem C: The Ledger

CHALLENGE
Difficulty: advanced+25 XP

**Bài toán.** Given n integers and a range [L, R], count non-empty contiguous subarrays whose sum lies in [L, R]. **Constraints:** 1 ≤ n ≤ 60000; −99 ≤ a[i] ≤ 99; −10^4 ≤ L ≤ R ≤ 10^4. **Input:** line 1: n, L, R; line 2: n values. **Output:** one integer — the count (fits in 64 bits).

Back to lesson: Practice: Mock Contests 1 & 2