Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя pratikshaw

Автор pratikshaw, история, 15 месяцев назад, По-английски

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

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
15 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
15 месяцев назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

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