Problem 466C

Правка en1, от ebanner, 2016-10-29 19:46:02

This is documentation for my solution to 466C - Number of Ways. Credit for Coding Hangover for the algorithm. This post will detail the approach here, as well as provide an example.

Problem Statement

Given an array arr, we are to compute the number of ways we can partition arr into chunks where each chunk is contiguous. Further, the sum of the elements in each chunk must be the same.

Naive Approach

My first approach to this problem was to pre-compute an array A which is a running sum of arr. Concretely, A[i] = sum(a[:i]) inclusive.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en7 Английский ebanner 2016-10-29 21:29:39 259 (published)
en6 Английский ebanner 2016-10-29 21:27:49 527 Tiny change: 'nk sum up up to the' -
en5 Английский ebanner 2016-10-29 21:06:10 3732
en4 Английский ebanner 2016-10-29 20:40:43 1001 Tiny change: 'explained along with an e' -
en3 Английский ebanner 2016-10-29 20:15:37 1803
en2 Английский ebanner 2016-10-29 19:55:58 884
en1 Английский ebanner 2016-10-29 19:46:02 658 Initial revision (saved to drafts)