JOI 2016 Open Contest Skyscraper

Правка en3, от zscoder, 2016-06-25 15:49:45

Problem Statement

Abridged Problem Statement : Given a1, a2, ..., an, find the number of permutations of these numbers such that |a1 - a2| + |a2 - a3| + ... + |an - 1 - an| ≤ L where L is a given integer.

The editorial given is quite brief and the sample code is nearly unreadable. I have no idea how to do the dp.

Can anyone explain the solution? Thanks.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский zscoder 2016-06-25 17:28:19 161
en3 Английский zscoder 2016-06-25 15:49:45 2 Tiny change: 'a_{n - 1} + a_{n}| \l' -> 'a_{n - 1} - a_{n}| \l'
en2 Английский zscoder 2016-06-22 12:11:00 12
en1 Английский zscoder 2016-06-22 12:06:45 623 Initial revision (published)