se_crack1122's blog

By se_crack1122, 3 years ago, In English
first question 
given an array a[] of size n and we are asked q queries and there will be 3 types of queries
1 l r for each i in l <= i <= r ai = ai/d where d is the smallest prime factor of ai
2 l r print the sum of all ai with l <= i <= r
3 i k set ai = k

constraints:
1 <= n <= 2e5
1 <= q <= 1e5
1 <= ai , k <= 1e6

sample test case:
5 3
10 2 8 7 6
2 1 4
1 1 4
2 1 4


second ques:
I have attached the images of the second ques

 First part  Second part Third part

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it