How to solve following problem?

Правка en1, от debugger2017, 2016-06-25 21:53:19

Given an array, find the number of increasing sub-sequences having GCD=1 Example: A={1, 2, 3} Output: 5 The increasing sub-sequences are {1},{1,2},{1,2,3},{1,3},{2,3} The only approach I can think is to try all the possible sub-sequences and calculate their GCD.

Теги #algorithms, array

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский debugger2017 2016-06-25 21:53:19 298 Initial revision (published)