Permutation without an arithmetic sequence.

Правка en1, от ggok, 2015-09-30 15:26:18

Hi, I recently came across this question and i have no idea how to approach it.

You are given a number N (3 ≤ N ≤ 100000) and you should create a permutation of the first N numbers.

The permutation should not have an arithmetic subsequence with three or more terms in it.

for example

5             4 2 3 1 5
3             3 1 2

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ggok 2015-09-30 15:26:18 395 Initial revision (published)