×

# Help needed in LCM range query problem

 0 Given an array A of N (N<=2*10^4) elements and Q(Q<=10^6) queries. Each array element A[i]<=60. In each query you are given a number K (K<=N). Compute LCM for all subarrays of size K and report the smallest value of LCM found. Please suggest some approach for this problem. asked 18 May '18, 23:06 3★lakh 139●5 accept rate: 23% Please post the link of the question for which you ask for help. It makes for us easy to verify our approach, before answering the question. (18 May '18, 23:49) sorb19974★ http://codeforces.com/problemset/gymProblem/100570/A (18 May '18, 23:51) lakh3★ I tried storing precomputed results for subarrays of size<=sqrt(N) and for subarrays with size>sqrt(N), I used the brute force way but got TLE. (18 May '18, 23:59) lakh3★ http://codeforces.com/blog/entry/15722 The tutorial for the problem. It is on right panel on codeforces under contest materials (19 May '18, 05:27) I am looking for some other approach possible to solve this problem (19 May '18, 08:29) lakh3★
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×836
×92
×65

question asked: 18 May '18, 23:06

question was seen: 119 times

last updated: 19 May '18, 08:29