GCD Subarray Game
GCD Subarray Game easy Time Limit: 2 sec Memory Limit: 128000 kB
Last updated
GCD Subarray Game easy Time Limit: 2 sec Memory Limit: 128000 kB
Last updated
Problem Statement:
You are given an array A of size N. Find if there is any subarray in the array whose GCD is equal to 1. Input The first line of the input contains a single integer N. The second line contains N space seperated integers.
Constraints: 1 <= N <= 105 1 <= Ai <= 109 Output Print "YES" if there is any subarray in the array whose GCD is equal to 1, else print "NO", without the quotes. Example Sample Input: 5 6 2 5 3 1
Sample Output: YES
link: