How to solve this problem

Revision ru2, by RetiredPlayer, 2020-08-04 00:14:16

Today I created this problem, idk maybe it exists somewhere

We have array of n numbers n <= 2e4, a[i] <= 1e6 And we have q queries q <= 2e4, 1 <= l <= r <= n

Initially we have subset with element a[l:r], we need to erase minimal number of elements from this subset so that gcd(subset) > 1 gcd of subset becomes bigger than 1

I have some idea but idk if it’s right

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
ru2 Russian RetiredPlayer 2020-08-04 00:14:16 20
ru1 Russian RetiredPlayer 2020-08-03 23:04:29 766 Первая редакция (опубликовано)