Perfect Cube
Practice
3.7 (13 votes)
Basic programming
C++
Problem
14% Success 4597 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Given an array \(A\) of \(N\) integers.

Find the count of subarrays whose product of elements is a perfect cube.

Input Format:

  • First line contains an integer \(N\).
  • Next line contains \(N\) space-separated integers denoting the array elements.

Output Format:

Print the number of subarrays whose product of elements is a perfect cube.

Constraints:

\(1 \le N \le 10^5 \\ 1 \le A[i] \le 10^2\)

 

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
19 votes
Tags:
Basic ProgrammingEasy
Points:20
77 votes
Tags:
ApprovedBasic ProgrammingEasyImplementationOpen
Points:20
52 votes
Tags:
Ad-HocApprovedEasyOpen