exec_outcome
stringclasses
1 value
code_uid
stringlengths
32
32
file_name
stringclasses
111 values
prob_desc_created_at
stringlengths
10
10
prob_desc_description
stringlengths
63
3.8k
prob_desc_memory_limit
stringclasses
18 values
source_code
stringlengths
117
65.5k
lang_cluster
stringclasses
1 value
prob_desc_sample_inputs
stringlengths
2
802
prob_desc_time_limit
stringclasses
27 values
prob_desc_sample_outputs
stringlengths
2
796
prob_desc_notes
stringlengths
4
3k
lang
stringclasses
5 values
prob_desc_input_from
stringclasses
3 values
tags
listlengths
0
11
src_uid
stringlengths
32
32
prob_desc_input_spec
stringlengths
28
2.37k
difficulty
int64
-1
3.5k
prob_desc_output_spec
stringlengths
17
1.47k
prob_desc_output_to
stringclasses
3 values
hidden_unit_tests
stringclasses
1 value
PASSED
609809b3a1150e587ce58e66604d961f
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class Aa { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); int n = 0; int a = 0; int s = 0; int c = 0; for(int i=1;i<=t;i++){ ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
784b975d6f5033807d2f2153879edbbd
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class Main { public static void main(String args[]){ Scanner in = new Scanner(System.in); int t = in.nextInt(); while(t-->0){ int n = in.nextInt(); int a[] = new int[n]; for(int i = 0; i < n; i++){ a[i] = in.nextI...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
b2fa78f88b883ca96af00e9d321f78ff
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
// package codeforces; import java.io.*; import java.util.*; public class Setup { static int nextInt() throws IOException { return Integer.parseInt(next()); } static long nextLong() throws IOException { return Long.parseLong(next()); } private static String next() throws IOException { wh...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
0f48326050f14d642890709f4d70c34a
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. ***********************************************...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
2147adcb02db913709384fee3a3bad8f
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. ***********************************************...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
de33e386934a7a824cb29d34164e32ec
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { int n = sc.nextInt(); int arr[] = new int[n]; for(int i=0;i...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
db538c1c86ea3764515683248dc36ade
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/* package codechef; // don't place package name! */ import java.io.*; import java.lang.*; import java.util.*; import java.util.Collection; import static java.lang.Math.*; public class Main implements Runnable { public void run() { InputReader s = new InputReader(System.in); Pri...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
bc96380edd629a56778ed1e06f53c8d5
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class PerfectImperfectArray { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); if (t < 1 || t > 100) return; fo...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
49a490683fc81db8baae2cc85503fd5e
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class TestMain { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader( ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
d9ea10527cfc5ac73e44ccbfdc81684c
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main(String args[])throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.readLine()); in...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
40e4d794aa7c1265c609485b8b0e379f
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here Sca...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
3c0a8e41be396b4b45e31eadc1098d4b
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class A { public static void main(String args[]) throws IOException { FastReader sc = new FastReader(); PrintWriter out = new PrintWriter(System.out); int tc, i, j; String s; char p; tc = sc.nextInt(); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
eb110e7f6b48ff8dd631cb1d87ca536c
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class A_Perfectly_Imperfect_Array { static Scanner in=new Scanner(); static PrintWriter out=new PrintWriter(System.out); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
e9c8561af2e0a4102002f4e7bdf48ecb
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(bf...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
cd9a12c8c184dd47f3e55be07470aac4
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t=sc.nextInt(); while (t-->0) { int n=sc.nextInt(); int a[]=new int[n]; int flag=0; double b[]=new ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
7750e1e0a86fcd69f0fda6617d909530
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class Demo { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // A. int t = sc.nextInt(); while(t-->0) { int n = sc.nextInt(); int a[] = new int[n]; for(int i=0; i<n; i++) a[i] = sc.nextInt(); int cnt=0; for(in...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
9ec5d362bf47e7796aa0c3aeabaa1698
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.awt.image.AreaAveragingScaleFilter; import java.io.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.util.*; public class Pratice { final long mod = 1000000007; static StringBuilder sb = new StringBuilder(); static int xn = (int) (2e5 + 10); static long a...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
6160d711e27dfabe3429f079a3411efe
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; import java.util.StringTokenizer; public class Hello { static long mod=(long) (Math.pow(10, 9)+7); public static void main(String[] args) { FastScanner sc=new FastScanner(); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
dd14ae6bd3e0aaab6d39f00e9dad2125
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Math.*; import static java.lang.System.out; import java.util.*; import java.io.PrintStream; import java.io.PrintWriter; import java.math.BigInteger; public class A { /* 10^(7) = 1s. *...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
8bd28b445321a03fbe824435a8802c1f
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Math.*; import static java.lang.System.out; import java.util.*; import java.io.PrintStream; import java.io.PrintWriter; import java.math.BigInteger; public class A { /* 10^(7) = 1s. *...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
a4bb8214463eab3ceaf6ab5343a43f43
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Math.*; import static java.lang.System.out; import java.util.*; import java.io.PrintStream; import java.io.PrintWriter; import java.math.BigInteger; public class A { /* 10^(7) = 1s. *...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
c91818955cdc95e4d513c2f1a88e2045
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class solution_codeforces { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int T = scan.nextInt(); while(T-- > 0){ int n = scan.nextInt(); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
bc382bf2f8cce3786f1fcde7d73bf8df
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args)throws java.lang.Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.readLine()); while(t-->0) { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
f1479da867f6bc2893a980a0cef9c143
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.lang.reflect.Array; import java.util.*; import java.io.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { // write your code here PrintWriter out = new PrintWriter(System.out); FastReader sc...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
5127700af6342b102545e3e44adca90e
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++) { int n = sc.nextInt(); boolean ans = true; for (int j = 0; j < n; j++) { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
142c029f3221b803b0ddbd04b8b6d8e0
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; public class Main { //input static out op = new out(); static inp ip = new inp(); static FastReader sc = new FastReader(); static BufferedWriter output = new BufferedWriter( new OutputStreamWriter(System.out)); /...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
f602b0ebfe7d2a9af6eb7cd9c377075f
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.lang.Math; public class Account { public static void main (String[] args) { Scanner sc= new Scanner(System.in) ; int t= sc.n...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
4266568b137a4214f71c2e051627e0af
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class B { public static void main(String[] args) throws IOException { //StringBuffer sb=new StringBuffer(""); Scanner sc=new Scanner(System.in); int ttt=sc.nextInt(); while(ttt-->0) {int ans=0; int a=sc.nextInt();int n...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
c0ed5de55305b6b3c8cc741404f3ddff
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class Problem{ public static void main(String[] args) { Scanner input = new Scanner(System.in); int t = input.nextInt(); for (int i =0 ; i< t; i++){ int n = input.nextInt(); boolean a = false; for (int...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
6e17d8c1ecf8cc3c6dc03f28c7559bae
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class a { static class FastScanner { InputStreamReader is; BufferedReader br; StringTokenizer st; public FastScanner() { is = new InputStreamReader(System.in); br = new BufferedReader(is); } String next() throws Exception { while (st == null...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
3233ad9e3a48515470dd51ff0ccb2252
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class a { static class FastScanner { InputStreamReader is; BufferedReader br; StringTokenizer st; public FastScanner() { is = new InputStreamReader(System.in); br = new BufferedReader(is); } String next() throws Exception { while (st == null...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
2e950bf0aa858b09cd8c94a319b109ad
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.lang.Math; import java.util.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
ee66a83690df701c48f24a19135a228a
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class cp { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
ecce48946c965e42a0f04f7ffc372464
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Solution { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int k=1;k<=t;k++) { int n = sc.nextInt(); int[] a = new int[n]; for(int i=0;i<n;i++) {...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
58d34574116f0adf56f020efdde52178
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class MyClass{ static boolean perfs(int x){ int p=(int)Math.sqrt(x); return p*p==x; } static void solve(int a[],int n){ for(int i=0;i<n;i++) { if(!perfs(a[i])) {System.out.println("YE...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
440cefe9769b7154858cd0b41e7b3b7a
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.lang.*; public class Main{ static boolean isPerfectSquare(double x) { if (x >= 0) { double sr = Math.sqrt(x); sr=(int)Math.ceil(sr); return ((sr * sr) == (int)x); } return false; } public static void ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
a410dc7e64c1d44b5d71b121177a86d0
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. *****************************************************...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
37f0922b3c961be891027fc5460cb40b
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class CP { static class FastIO { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(""); public String next() {...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
3ef5d20f797ee821e2b6e665bfd08e87
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class Stack1 { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
3f0d06854097faed34f0e47b0520d14a
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Random; import java.util.Stack; impor...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
4bcf3cdca519f3e3920d997e263c53b1
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/*package whatever //do not write package name here */ import java.util.*; public class GFG { public static void main (String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int o=0;o<t;o++){ HashSet<Integer> hs=new HashSet<>(); for(int i=1;i<10000;i++){ hs...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
bb04697acecdc4e76f631f1dca4068d8
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/*package whatever //do not write package name here */ import java.util.*; public class GFG { public static void main (String[] args) { Scanner sc=new Scanner(System.in); HashSet<Integer> hs=new HashSet<>(); for(int i=1;i<10000;i++){ hs.add(i*i); } int t=sc.nextInt(); for(int o=0;o<t;o+...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
c39f849328f903c131707d09e9ed2311
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/*package whatever //do not write package name here */ import java.util.*; public class GFG { public static void main (String[] args) { Scanner sc=new Scanner(System.in); HashSet<Integer> hs=new HashSet<>(); for(int i=1;i<100000;i++){ hs.add(i*i); } int t=sc.nextInt(); for(int o=0;o<t;o...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
186dc03cee091a9384e2ee00ccd9904c
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; public class Main{ static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElement...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
b31920004c7c8f1d039016e8d892cdf5
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class A_Perfectly_imperfect_array { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); int[] arr=new int[n]; for (int i = 0; i < n; i+...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
763143657396caabc5c3ed573b796c20
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class CodeForces800_3 { static Scanner sc; public static void main(String[] args) { sc=new Scanner(System.in); int t=sc.nextInt(); while(t>0){ System.out.println(Process()); t--; } } pu...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
4cd9e21b68065299703f8361a8a87d26
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; public class A{ public static FastReader sc=new FastReader(); public static PrintWriter out = new PrintWriter(System.out); public static void taskSolver(){ int n=sc.nextInt(); int arr[]=new int[n]; for(int i=0;i<n;i++)arr[i]=sc.nextI...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
ab4176b4c68b552ab5f9e918e795e688
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; public class A{ public static FastReader sc=new FastReader(); public static PrintWriter out = new PrintWriter(System.out); public static void taskSolver(){ int n=sc.nextInt(); int arr[]=new int[n]; for(int i=0;i<n;i++)arr[i]=sc.nextI...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
9bc4bd44311dcfa7d4a13680727535eb
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.lang.*; public class Student { public static void main(String [] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); for(int i=0 ; i<t ; i++) { boolean x = true; int n = scan.nextInt(); int []arr = new int[n]; for(int l=0 ; l<n ; l++) ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
6a77679941f7da83185529ec63763332
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.lang.Math; public class Account { public static void main (String[] args) { Scanner sc= new Scanner(System.in) ; int t= sc.n...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
20f0b736e66f6507ee933b49bc76391a
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.lang.Math; public class Account { public static void main (String[] args) { Scanner sc= new Scanner(System.in) ; int t= sc.n...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
5a0c9a9d6fd9434ea2dfdc793039db8b
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class Main { public static void main (String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while (t --> 0) { int n = in.nextInt(); int[] arr = new int[n]; boolean perf = true; f...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
7fcb3909d5a208ed59c05c9afd1937a6
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { boolean flag=false; int n=sc.nextInt(); for(int i=0;i<n;i++) { int a=sc.nextInt(); int sq=(int)Math.sqrt(a); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
8d2f715a62d7aa67455573217d084a9c
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { static boolean checkPerfectSquare(double number){ double sqrt=Math.sqrt(number); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
a6e08f9329156a52c0e97fab07de145e
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class CodeTest { public static String check(int arr[]){ for(int i : arr){ if(Math.sqrt(i) - Math.floor(Math.sqrt(i)) != 0){ return "YES"; } } return "NO"; } public static void main(String...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
9f5a2160d7875d216a0d6edc712fcb58
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class A{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int T = in.nextInt(); for (int t=0; t<T; t++) { int N = in.nextInt(); boolean found = false; for (int n=0; n<N; n++) { i...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
de373b769c5ab4826edba3fc090f7931
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class cupballet { static int[] B,A; static int n,m; static int[][] DP; static boolean IsSquare(int N) { int i; for(i=1; N>0; i+=2) //变化步长为2, 初值为1,一直减到N大于0 { N-=i; } if(N==0) re...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
99331f33c0e69be26badf15226d7e6de
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class cupballet { static int[] B,A; static int n,m; static int[][] DP; static boolean IsSquare(int N) { int i; for(i=1; N>0; i+=2) //变化步长为2, 初值为1,一直减到N大于0 { N-=i; } ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
7bd5efef76e59c94422bfbf3076779ad
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Integer t = Integer.valueOf(sc.nextLine()); for (int i = 0; i < t; i++){ Integer s = Integer.valueOf(sc.nextLine()); String...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
01d6ce4e75a1cbcaa0ed4704b7bd10bd
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int T = scan.nextInt(); while(T -->0){ int n = scan.nextInt(); int[] a = new int[n]; for...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
beb0124ea21980e04175486a6c84e286
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public final class Solution { static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static long mod = (long) 1e9 + 7; static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(1, 0), new Pair(0, -1), new Pair(0, ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
b1e32d9af1d5fcbd4beb4f1dff7df074
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class A_Perfectly_Imperfect_Array{ static void main() throws Exception{ int n=sc.nextInt(); int[]in=sc.intArr(n); for(int i=0;i<n;i++) { for(int p=2;p*p<=in[i];p++) { if(in[i]%p!=0)continue; int cnt=0; while(in[i]%p==0) { cnt^=1; ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
9e92aac9baa94f718fe35db8e83f4621
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class MyCpClass { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next()...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
8b02427f7aedb58ccf4c54038d567d12
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { boolean flag=false; int n=sc.nextInt(); for(int i=0;i<n;i++) { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
985b010c5be1bfcbc630f5a23ff84d8a
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.sql.Array; import java.util.ArrayList; import java.math.*; import java.util.Scanner; import static java.lang.Math.sqrt; public class Main { public static void main(String []args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while((--t)>=0) { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
5bd8bd4b73b550b2d10342b1d60aeb22
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { static boolean checkPerfectSquare(int x) { double zz = (double)x; // finding...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
913712a2f7b7c9833947e92674c92cce
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class Experiment { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } if (...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
7f816e9da9b789fec044b169e1eff2c8
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n= sc.nextInt(); int[] arr = new int[n]; for(int i=0;i<n;i++){ arr[i] = s...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
60cebd5d40b4653868c9ecbad81f9563
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; public class A { static class Reader{ private BufferedReader reader; private StringTokenizer tokenizer; Reader(InputStream input) { this.reader = new BufferedReader(new InputStreamReader(input)); this.tokenizer = ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
07a2f76c59fb0448aeeca2c5536fe6c4
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
// package CODEFORCES_716_DIV_2; import java.util.*; import java.io.*; public class A { static class Reader{ private BufferedReader reader; private StringTokenizer tokenizer; Reader(InputStream input) { this.reader = new BufferedReader(new InputStreamReader(input...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
9198a81f6ee04d4bcfbf553cc0606dc3
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/** * * @author aditya */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class PerfectlyImperfect { public static void main(String[] args) { FastScanner fs=new FastScanner(...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
617de2250b04d4dff98d5b22d72be5ca
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. ***********************************************...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
ee53eda8cbb32c1d1f0d95c91dd8e2ac
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int t=In...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
904aca787ad9b37f7fc6ceac879d89d7
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class div_2_716_a { public static void main(String args[]){ FScanner in = new FScanner(); PrintWriter out = new PrintWriter(System.out); int t = in.nextInt(); while(t-->0) { int n=in.nextInt(); int a[]=in.readArray(n); double sum=1; boolean flag...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
db193978a2f6222504351463a151607c
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); for(int i=0;i<t;i++) { int n = scanner.nextInt(); boolean flag = false; for(int j=0;j<n;j++) { int a = scanner.nextInt(); int sa = (in...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
dfb22ab94abbe04afa52986aed75f02e
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class A71 { public static void main(String[] args) { Scanner s=new Scanner(System.in); int i = s.nextInt(); while (i!=0) { int n = s.nextInt(); boolean set = true; while (n!=0) { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
b3c90fe0f9e535695d1cd34bc67a216e
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class A { private final static Scanner scanner=new Scanner(System.in); public static void main(String[] args){ int a; int t=scanner.nextInt(); while (t--!=0){ int n=scanner.nextInt(); boolean flag=false; ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
acc0b83614e1a3c8462991a3d481d7ce
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; import java.util.Scanner; import java.util.StringTokenizer; public class A { public static void main...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
c6726f0d8b00b8579042a4e111e502d8
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.math.*; public class ImperfectArray { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int runs = sc.nextInt(); while(runs-->0) { int n = sc.nextInt(); double[] arr = new double[n]; for(int i = 0;i<n;i++) arr[i] = sc.nextDouble(); bo...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
fe343d4f0ee703b06cf2d568bbdcb215
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class Main { static int size; static int[] arr; static boolean isSquare(int num) { double doubleSqrt = Math.sqrt(num); int sqrt = (int) doubleSqrt; return doubleSqrt == sqrt; } static boolean solve(int[] arr) { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
1a10728b61ebbd6dc2b3df863a70ea09
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; import java.util.*; public class c716a { //By shwetank_verma static boolean pref(double x) { if (x >= 0) { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
3f77fbda41c6e4596021f975728b1763
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) { FastReader input=new FastReader(); PrintWriter out=new PrintWriter(System.out); int T=input.nextInt(); while(T-->0) { int n=input.nextInt(); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
8c0a344d366fc47004ab0cf4480cd74f
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class A1514 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while(T--!=0){ boolean flag = true; int size = sc.nextInt(); while(siz...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
cfdf2656b3376948e88a8656d89d4a3b
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; import java.util.Map.Entry; public class Codechef { static ArrayList<Integer> adj[]; static long ans = 0; static long above = 0; static List<Integer> factors = new ArrayList<>(); static FastReader f = new FastReader(); static int mod = 1000000007; public static void solv...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
d8bc264b148605f72aa820bcfc89b33d
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); boolean notPerfect = false; while(n-->0){ int input = sc.nextInt(); if(Math.sqrt(input) % 1 != ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
17a60784bdac8dc1c5dde94c62a010fa
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
/*----->Hope Can Set You Free<-----*/ import java.util.*; public class PerfactlyInperfectArray { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(),cnt=0,sq=0; int[] arr=new int[n]; for(int i=0;i<n;i++){ arr[i]=sc.nextI...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
677cb53ef1e47817a4e834c4d8f63f7c
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; public class PerfectlyImperfectArray { static boolean chk(int[] a) { for (int i = 0; i < a.length; i++) if ((int) Math.sqrt(a[i]) != Math.sqrt(a[i])) return true; return false; } public static void main(String[] args)...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
2e9f609d9aa309f7683803102e3c4c7f
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { BufferedReader in; PrintWriter out; Main() { in = new BufferedReader(new InputStreamReader(System.in)); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
88923ccdf2f958bbc8300dba20596e42
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; public class test { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while(t-- > 0){ int a = in.nextInt(); int[] arr = new int[a]; boolean b = true; for (int i = 0;...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
e9f6e7e30e4b806dec8dfdeef2c2471a
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class AAA { //--------------------------INPUT READER--------------------------------// static class fs { public BufferedReader br; StringTokenizer st = new StringTokenizer(""); public fs() { this(System.in); } public fs(Inp...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
004192bee15b47fc0797e84e0f58f8b0
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class Perfect { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { boolean flag=false; int n=sc.nextInt(); for(int i=0;i<n;i++) { int a=sc.nextInt(); int sq=(int)Math.sqrt(a); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
14c3f3843d23a59bcf9e928a0912de42
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; public class Main { static long startTime = System.currentTimeMillis(); // for global initializations and methods starts here // global initialisations and methods end here static void run() { boolean tc = true; AdityaFastIO r = new...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
6a46535e4c035317ab9a37cbbcc2f195
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.math.BigInteger; //import javafx.util.*; public final class B { static StringBuilder ans=new StringBuilder(); static FastReader in=new FastReader(); static ArrayList<ArrayList<Integer>> g; static long mod=1000000007; static int ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
ddb5b7565c54d5a0d2bc9c56dcd20bff
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); long kk = sc.nextLong(); while(kk-->0) { int length = sc.nextInt(); int[] arr = new int[length]; ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
10e614226890a3daf824e9f6ac66a520
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; public class Question4{ public static void main(String args[]){ Scanner In = new Scanner(System.in); int t = In.nextInt(); while(t>0) { int n = In.nextInt(); long a[] = new long[n]; int l = 7; for(int i=0;i<n;i++) { a[i] = In.nextLong(); double c1 = (dou...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
15318767c68be66aea8b581e1ee619ff
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.Scanner; import java.lang.Math; public class Main{ static boolean isPerfectSquare(double x){ if(x>=0){ long sr = (long) Math.sqrt(x); return (sr*sr==x); } return false; } public static void main(String[] args){ Scanner s = new Sca...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
923a418922b477aa869cea42ac69cb93
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; public class Solution{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int x=0; x<t; x++) { int n=sc.nextInt(); ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
104f0daf6ee52efbe91c2502e3c61323
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
// Piyush Nagpal import java.util.*; import java.io.*; public class C{ static int MOD=1000000007; static PrintWriter pw; static FastReader sc; static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { b...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
da85c9a1563c62edc220e18f93beaf81
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.*; import java.util.*; public class PerfectlyImperfectArray { public static void main(String args[]){ FScanner in = new FScanner(); PrintWriter out = new PrintWriter(System.out); int t = in.nextInt(); while(t-->0) { int n=in.nextInt(); int f=0; for(int i=0;i<n;i++) { ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output
PASSED
687e15f82164eed38faefc429d82e9f8
train_110.jsonl
1618839300
Given an array $$$a$$$ of length $$$n$$$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.A sequence $$$b$$$ is a subsequence of an array $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deleting some (possibly zero) elements.
256 megabytes
import java.io.PrintWriter; import java.util.*; import java.lang.*; public class Main { static int po(int n){ int a=2; int res=1; while(n>0){ if(n%2==0){ res*=a; n--; }else{ a*=a; n/=2; ...
Java
["2\n3\n1 5 4\n2\n100 10000"]
1 second
["YES\nNO"]
NoteIn the first example, the product of the whole array ($$$20$$$) isn't a perfect square.In the second example, all subsequences have a perfect square product.
Java 8
standard input
[ "math", "number theory" ]
33a31edb75c9b0cf3a49ba97ad677632
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$) — the length of the array $$$a$$$. The second line of each test case contains $$$n$$$ integers $$...
800
If there's a subsequence of $$$a$$$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".
standard output