pratikshaw's blog

By pratikshaw, history, 17 months ago, In English

Problem link : https://cses.fi/problemset/task/1194 Submission link: https://cses.fi/problemset/result/6625261/

I have done the problem in n*m which is the most optimised one, (1<=n,m<=10^3) . Even then I am getting TLE in one test case

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By pratikshaw, history, 17 months 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

Full text and comments »

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