pratikshaw's blog

By pratikshaw, history, 3 years ago, In English

You are given an array of size n, consisting of non negative integers. Find the number of subarrays of arr which are special. A subarray is special if it satisfies the following condition: The product of the maximum and the minimum element of the subarray is divisible by the length of the subarray. Find the number of special subarrays of the array.

1<=n<=1e5

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

| Write comment?
»
3 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Not able to find solution less than n^2. Please someone help

»
3 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

I think this has already been answered here.
https://mirror.codeforces.com/blog/entry/118209