For this Question: There are Q queries and for each query you are given a positive integer N. Find whether N is a perfect square or not. 

Expected Space Complexity: O(1)First line contains an integer Q - the number of queries.
Q lines follow, each line containing a single integer N.

Constraints
1 <= Q <= 10^5
1 <= Ai <= 10^9Print Q lines. Each line should contain either "YES" or "NO".Sample Input 1:
3
1
2
4

Output 
YES
NO
YES

Explanation:
1 and 4 are perfect squares.

Sample Input 2:
2
144
63

Output 
YES
NO

Explanation:
12 * 12 = 144, I have written this Solution Code: import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework

// don't change the name of this class
// you can add inner classes if needed
class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        long Q = sc.nextLong();
        while(Q-- > 0){
            long n = sc.nextLong();
            long sqrt = (long)Math.sqrt(n);
           
            if(sqrt*sqrt == n){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
        
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?