CSES - Datatähti 2023 loppu - Results
Submission details
Task:Pinta-ala
Sender:Septicuss
Submission time:2023-01-21 16:57:04 +0200
Language:Java
Status:COMPILE ERROR

Compiler report

input/B.java:14: error: package A does not exist
    final static A.FastReader reader = new A.FastReader();
                  ^
input/B.java:14: error: package A does not exist
    final static A.FastReader reader = new A.FastReader();
                                            ^
input/B.java:86: error: cannot find symbol
                Logger.getLogger(A.class.getName()).log(Level.SEVERE, null, ex);
                                 ^
  symbol:   class A
  location: class FastReader
3 errors

Code

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;

public class B {

    final static A.FastReader reader = new A.FastReader();
    final static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) {
        
        B clazz = new B();
        
        int t = reader.nextInt();
        
        for (int i = 0; i < t; i++)
            writer.println(clazz.solve(reader.nextInt(), reader.nextInt()) ? "YES" : "NO");

        reader.close();
        writer.flush();
        writer.close();
    }
    
    boolean solve(int A, int B) {
        double sqrtA = Math.sqrt(A);
        double sqrtB = Math.sqrt(B);
        
        return !(Math.floor(sqrtB) == Math.floor(sqrtA));
        
    }

    
    
    static class FastReader {

        BufferedReader reader;
        StringTokenizer tokenizer;

        public FastReader() {
            this.reader = new BufferedReader(new InputStreamReader(System.in));
            this.tokenizer = null;
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {

                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException ex) {
            }
            return null;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        BigInteger nextBigInt() {
            return new BigInteger(next());
        }

        void close() {
            try {
                reader.close();
            } catch (IOException ex) {
                Logger.getLogger(A.class.getName()).log(Level.SEVERE, null, ex);
            }
            reader = null;
            tokenizer = null;
        }

    }

}