Help me solve this problem!

Правка en1, от 19Doors, 2025-07-13 13:15:33

Problem Statement

Captain Ascending has discovered an ancient treasure map that reveals hidden fortunes along a mystical coastline.

The map is represented by an array A of length N, where each element A[i] indicates the treasure value (which may be negative or positive) at that location.

To unlock the ultimate riches, the captain believes his journey must be divided into segments in which the sum of treasures in each segment (called its "beauty") strictly increases as he moves from one segment to the next. The beauty of a range [L, R] in the array A is defined as the sum of the elements from A[L] to A[R].

The captain wishes to partition the array A into non-intersecting, contiguous subarrays such that, when each subarray is replaced by its beauty, the resulting sequence forms a strictly increasing progression.

Find the total number of ways to partition the array A into contiguous subarrays so that the sequence of beauties is strictly increasing. Since the answer can be very large, return it modulo 10^9 + 7.

Input Format

  • The first line contains an integer, N, denoting the number of elements in A.
  • Each of the N subsequent lines contains an integer, A[i].

Constraints

  • 1 <= N <= 1000
  • -10^9 <= A[i] <= 10^9

[1] https://pplx-res.cloudinary.com/image/private/user_uploads/63892823/a14f8f6e-7932-4549-b20d-e08c9b6242c7/p1.jpg

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en7 Английский 19Doors 2025-07-13 13:21:28 24
en6 Английский 19Doors 2025-07-13 13:20:43 1442
en5 Английский 19Doors 2025-07-13 13:20:11 9
en4 Английский 19Doors 2025-07-13 13:19:41 2129
en3 Английский 19Doors 2025-07-13 13:16:02 0 (published)
en2 Английский 19Doors 2025-07-13 13:15:49 119 (saved to drafts)
en1 Английский 19Doors 2025-07-13 13:15:33 1466 Initial revision (published)