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
b5b86d9173f8de26563f6c7fc746200b
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class ComdeFormces { static int dp[][]; static boolean mnans; static int x[]= {-1,0,0,1}; static int y[]= {0,-1,1,0}; static int ans[]; public static void main(String[] args) throws Exception{ // TODO Auto-generated method stub FastR...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
3bf3ef04f58d42d416dc65ed3f787918
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.util.*; public class Main { static Reader r = new Reader(); static StringBuilder sb = new StringBuilder(); static int n,m; static int grid[][], visited[][]; static int[] dx = {-1,-1,-1,0,0,1,1,1}; static int[] dy = {-1,0,1,-1,1,-1,0,1}; public stati...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
676fb93d7bf07a76e07d0dda32ad8a53
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
// JAI SHREE RAM, HAR HAR MAHADEV, HARE KRISHNA import java.util.*; import java.util.Map.Entry; import java.util.stream.*; import java.lang.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.io.*; public class CodeForces { static private final String INPUT = "input.txt"; s...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
2cb2836fe2c440a0138c3a6ac6ef900e
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.util.*; public class Main { static FastReader scanner = new FastReader(); public static void solve() { int n = scanner.nextInt(); int[] arr = new int[n]; if (n == 3) { System.out.println("2 1 3"); return; }...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
51f373d63b78a58fd276e67189b32e4f
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
/* "Everything in the universe is balanced. Every disappointment you face in life will be balanced by something good for you! Keep going, never give up." Just have Patience + 1... */ import java.util.*; import java.lang...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
506e2308a0169f4174bd2aaffdd0eb96
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
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 Main { //------------------------------------------------input class---------------------------------------// ...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
660ab2a4f92782b5671170110da65217
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.util.Scanner; public class _1722G { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int cases=sc.nextInt(); while(cases--!=0) { //For every Testcase int n=sc.nextInt(); int case1=0; int case2=0; fo...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
898e83ae9b7c30a919a41592fde1f4c0
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); int g = Integer.parseInt(bf.readLine()); while (g-- > 0) { int a=Integer.parseI...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
21ec8add5c7aaffc87cf4a49a31d902b
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
//<———My cp———— //https://takeuforward.org/interview-experience/strivers-cp-sheet/?utm_source=youtube&utm_medium=striver&utm_campaign=yt_video import java.util.*; import java.io.*; public class Solution{ static PrintWriter pw = new PrintWriter(System.out); static FastReader fr = new FastReader(System.in);...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
4583aba8b97f2d85ce83f7a1a895b9a4
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class New { public static void main (String[] args) throws java.lang.Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); int testCases = Integer.parseInt(...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
78ea39c675996231218e33321bfcd006
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.util.*; import java.io.*; public class Main { static ContestScanner sc = new ContestScanner(System.in); static PrintWriter pw = new PrintWriter(System.out); static StringBuilder sb = new StringBuilder(); public static void main(String[] args) throws Exception { int T = sc....
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
ca55de37fd0f5f35fe35b41d8568b547
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.util.*; public class Main { public static int INF = 0x3f3f3f3f, mod = 1000000007, mod9 = 998244353; public static void main(String args[]){ try { PrintWriter o = new PrintWriter(System.out); boolean multiTest = true; // init ...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
d7676f9556214529d33250cc3c1c78d0
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
// JAI SHREE RAM, HAR HAR MAHADEV, HARE KRISHNA import java.util.*; import java.util.Map.Entry; import java.util.stream.*; import java.lang.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.io.*; public class CodeForces { static private final String INPUT = "input.txt"; s...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
6fde644e1745cf231e376ca109a99cfe
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; import static java.lang.Math.*; import static java.util.Arrays.sort; public class Codeforces { public static void main(String[] args) { FastReader fastReader = new ...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
637e917c171a8445a73ad08e00bc05d9
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.util.*; import java.io.*; public class g { //FastReader public static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
a2f0ebb44b3323ff50bdf94634a15917
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.util.*; public class Codeforces { static final int MOD = (int)1e9 + 7; // Function to return (x^y) % MOD // in O(log(y)) static long power(long x, long y) { long res = 1; while (y > 0) { if ((y & 1) != ...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
3617333d9bbedb34a551147afc8f217e
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { static AReader scan = new AReader(); static void solve() { int n = scan.nextInt(); int p = n % 4; if(p == 0){ for(int i = 1,j = 100;i<=n;i+=4,...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
77458f249d8de88a8e7831f821ffbda4
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { static final PrintWriter out =new PrintWriter(System.out); static final FastReader sc = new FastReader(); //I invented a new word!Plagiarism! //Did you hear about the mathematician who’s afraid of negative numbers?He’l...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
0c8fe7da2da3cc52893378b8a78bd889
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.text.DecimalFormat; import java.io.*; import java.util.*; public class Main { static class Pair { int a,ind; public Pair(int a,int ind) { this.a=a; this.ind=ind; } } static final int INF = 1 << 30; static final lo...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
5755e35bfd2796c24fd14599244fc291
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.util.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class G_Even_Odd_XOR { public static void s() { int n = sc.nextInt(); int[] arr = new int[n]; int curr = 1; int xor = 0; for(int i=0; i<n; i+=...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
4bcd6776d536ba2be89f2383181531cb
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.util.ArrayList; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int test...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
41e96bb06cc3bc620d150f56d4c6a86c
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.util.*; public class Codeforces { static final int MOD = (int)1e9 + 7; // Function to return (x^y) % MOD // in O(log(y)) static long power(long x, long y) { long res = 1; while (y > 0) { if ((y & 1) !=...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
987abdf06f01b56e5a9e2ded75558271
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.util.*; public class G { static IOHandler sc = new IOHandler(); public static void main(String[] args) { // TODO Auto-generated method stub int testCases = sc.nextInt(); for (int i = 1; i <= testCases; ++i) { solve(i); } } private static void solve(i...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
9026ec70f545ba51a76f0eff9650da7f
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.util.*; public class R817G { public static void main(String[] args) { JS scan = new JS(); int t = scan.nextInt(); while (t-- > 0) { int n = scan.nextInt(); int xor1 = 0; int xor2 = 0; int[] ans = new in...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
b730b7195afbddc83f8082d14207f879
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.util.*; public class CF_817 { static FastScanner fs; static FastWriter fw; static boolean checkOnlineJudge = System.getProperty("ONLINE_JUDGE") == null; private static final int[][] kdir = new int[][]{{-1, 2}, {-2, 1}, {-2, -1}, {-1, -2}, {1, -2}, {2, -1}, {2, 1...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
63ddd73822930be9c63b7b30e4340059
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
// Even-Odd XOR // // Codeforces // Solution by Anmol Sharma import java.util.*; import java.lang.*; import java.io.*; public class Main { public static long mod = 1000000007; public static long mod2 = 998244353; public static void main(String[] args) throws java.lang.Exception { ...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
4b606470a2529efc36bbb17a5fe34173
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.*; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; import java.util.*; import java.util.concurrent.LinkedBlockingDeque; import java.io.FileWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; // graph, dfs,bfs,...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
361049874cec200fc9742e28c77d5cc5
train_109.jsonl
1661871000
Given an integer $$$n$$$, find any array $$$a$$$ of $$$n$$$ distinct nonnegative integers less than $$$2^{31}$$$ such that the bitwise XOR of the elements on odd indices equals the bitwise XOR of the elements on even indices.
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import j...
Java
["7\n8\n3\n4\n5\n6\n7\n9"]
1 second
["4 2 1 5 0 6 7 3\n2 1 3\n2 1 3 0\n2 0 4 5 3\n4 1 2 12 3 8\n1 2 3 4 5 6 7\n8 2 3 7 4 0 5 6 9"]
NoteIn the first test case the XOR on odd indices is $$$4 \oplus 1 \oplus 0 \oplus 7 = 2$$$ and the XOR on even indices is $$$2 \oplus 5 \oplus 6 \oplus 3= 2$$$.
Java 11
standard input
[ "bitmasks", "constructive algorithms", "greedy" ]
52bd5dc6b92b2af5aebd387553ef4076
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 629$$$) — the number of test cases. Then $$$t$$$ lines follow, each containing a single integer $$$n$$$ $$$(3 \leq n \leq 2\cdot10^5)$$$ — the length of the array. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\...
1,500
For each test case, output one line containing $$$n$$$ distinct integers that satisfy the conditions. If there are multiple answers, you can output any of them.
standard output
PASSED
e6268a6922c33f6291ddfa5c5638e016
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import java.util.*; import java.io.*; import java.math.*; /** * * @Har_Har_Mahadev */ public class F { private static int m, n; private static int[][] vis; public static void process() throws...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
2180faa941ab0b97247992719ddcc6fb
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintStream; import java.lang.reflect.Array; import java.util.*; import java.util.function.IntFunction; import java.util.function.IntUnaryOperator; import java.util.function.ToIntFunction; import java.ut...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
f965ec41d58b4ef33e112b26dc4ea664
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Main { // static int[] prime = new int[100001]; final static long mod = 1000000007; public static void main(Strin...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
611efc4ecf4054e3424b09e5a3bb7be9
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.Scanner; public class problemF { public static int n, m; public static char[][] a; public static int[][] dd; public static boolean isValid(int i, int j) { if (i >= 1 && i <= n && j >= 1 && j <= m) return true; return false; } public st...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
a6ea42e6c3f6d78c087c60c4996399fa
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; public class Test1 { static int[] dir = new int[] { 0, 1, 0, -1, 0 }; static int[] diag = new int[] { 1, 1, -1, -1, 1}; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tc = sc.nextInt(); while(tc-->0) { int row = sc.nextInt(),...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4f4e86d3400bda865e7de191b5bd638f
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; public class Test1 { static int[] dir = new int[] { 0, 1, 0, -1, 0 }; static int[] diag = new int[] { 1, 1, -1, -1, 1}; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tc = sc.nextInt(); while(tc-->0) { int row = sc.nextInt(),...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
566b3dd9cd40856223cf4086de8712f3
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class CF1722F extends PrintWriter { CF1722F() { super(System.out); } Scanner sc = new Scanner(System.in); public static void main(String[] $) { CF1722F o = new CF1722F(); o.main(); o.flush(); } int n, m; byte[][] cc; int count1(int i, int j) { return i >= 0 && i...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
51c62d8e5b9a7029dea6c4717d41a0b7
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.nio.charset.StandardCharsets; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class CF1722F { public static void main(String[] args) { Scanner scanner = new Scanner(System.in, StandardCharsets.UTF_8); int t = scanner.nextInt(); for ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d80174830e82c601b1789b031931b1f4
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedInputStream; import java.util.*; public class F { static final int[][] dirs = { {-1, 0}, {-1, -1}, {-1, 1}, {0, 1}, {0, -1}, {1, 0}, {1, -1}, {1, 1} }; static boolean handle(char[][] chess, boolean[][] used, int y, int x) { ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
ea8df0b24731d641c06121a24a1ba664
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; /* * Author: Atuer */ public class Main { // ==== Solve Code ====// static int INF = 2000000010; public static void csh() { } public static void main(String[] args) throws IOException { // csh(); int t = in.nextInt(); while (t-- > 0) { ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
5bcf11acb7df0edbbe537be682ca69fb
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; import java.util.concurrent.atomic.AtomicBoolean; public class Solution{ static int[] dx = {-1, 0, 1}; static int[] dy = {-1, 0, 1}; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scan...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e2e52b300c5306a1fcc1d3ea4257b68d
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
//package kg.my_algorithms.Codeforces; import java.io.*; import java.util.*; public class Solution { private static final int[][] directions = {{1,0},{-1,0},{1,1},{-1,1},{1,-1},{-1,-1},{0,-1},{0,1}}; private static final List<List<Point>> LShapedPoints = List.of(List.of(new Point(1,0),new Point(1,1)),L...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
2951f0b044a6e62a0b9416bf5fcf0cf8
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; public class Main { public static boolean [][] vis; public static char [][] g; public static int [] dx = new int[] {-1,-1,-1,0,0,1,1,1}; public static int [] dy = new int[] {-1,0,1,1,-1,-1,0,1}; public static int n,m; public static void main(String[] args) { ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d67c229810f23a24c9f0b81ce98ed939
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class F { final static boolean multipleTests = true; Input in; PrintWriter out; public F() { in = new Input(System.in); out = new PrintWriter(System.out); } public static void main(String[] args) { F solution =...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
bdc44e8409d39eaf21b7462587a3be51
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.awt.Rectangle; import java.io.*; import java.math.BigInteger; import java.util.*; /** * * @author eslam */ public class Solution { // Beginning of the solution static Kattio input = new Kattio(); static BufferedWriter log = new BufferedWriter(new OutputStreamWriter(System.out...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 17
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e046eb01ce967e25a1b3363fdd4c5be0
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.nextL...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
364174c827163076fbffa076008e689f
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e4e5a59e12ba536224b7d03fb22958ee
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
a5a36a1015f47481a3ce1409c2ff2c8a
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
8ef424d490266c570cf4f3130e7c773f
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
697ffd4561be490845c77b7105ad4354
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e160ac030befad469a850219a4393a35
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
70ab61cf5e239b45cf34f3c99b43fbf7
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
b77de7ff505948a782bf43bf55be40d9
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
a0198d6a6b1419f5a83ecfc4d4021957
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d84f293ac695322f96cb241c8b373c53
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class LShapes { private static final int START_TEST_CASE = 1; public static void solveCase(FastIO io, int testCase) { final int N = io.nextInt(); final int M = io.nextInt(); char[][] S = new char[N][]; for (int i = 0; i < N; ++i) { S[i] = io.ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
aaf55301c62a33246c6de116707cea03
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; public class Main { private static boolean check(int[] a, int[] b, int[] c) { if (a[0] - 1 == b[0] && a[1] == b[1] && a[0] == c[0] && a[1] - 1 == c[1]) { return true; } if (a[0] - 1 == c[0] && a[1] == c[1] && a[0] == b[0] && a[1] - 1 == b[1]) { ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
f37b98d786204e1a7f70e6a1eb380aef
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class TaskF { static int[][] fillX = { {1, 1}, {1, 1}, {0, 1}, {1, 0} }; static int[][] fillY = { {0, 1}, ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
86bffe1c31cdb5060824cc85dfd79e1b
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String args[]) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
243c6c3af615717957c4291c06171caf
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String args[]) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
46ea91584f8deb0624184f33d5107c79
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class HarHarShambhu{ static Scanner in=new Scanner(); static long systemTime; static long mod = 1000000007; //static ArrayList<ArrayList<Integer>> adj; static int seive[]=new int[1000001]; sta...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c43738ec1ba75289c5da9cbb664ae3a4
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class MainF { static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStream...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
87d396dcd98a2824e51b66fd9761f659
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Scanner; import java.util.Set; public class Main { static int[]dx= {0,0,-1,1,1,-1,1,-1}; static int[]dy= {1...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
994ec076521255e3a679b52de5f548e8
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; import java.util.Map.Entry; public class Main { // static int [] arr; // static boolean prime[] = new boolean[1000]; // static int l; // static String s; static StringBuilder sb; // static HashSet<L> hs; // static HashSet<Long> hs = ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
ee68ee27d11b5de4dda597acd605cd11
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class Main { static final int INF = 0x3f3f3f3f; static final long LNF = 0x3f3f3f3f3f3f3f3fL; static char a[][]; static boolean h[][]; static int m,n; public static void main(String[] args) throws IOException { initR...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
0684c4aa34ee099e4c7e6a9b12b142b6
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; /* * Author: Atuer */ public class Main { // ==== Solve Code ====// static int INF = 2000000010; public static void csh() { } public static void main(String[] args) throws IOException { // csh(); int t = in.nextInt(); while (t-- > 0) { ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
151a2704ef3b3f4a4f5469ca10aa76f8
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; /* * Author: Atuer */ public class Main { // ==== Solve Code ====// static int INF = 2000000010; public static void csh() { } public static void main(String[] args) throws IOException { // csh(); int t = in.nextInt(); while (t-- > 0) { ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
0f299bb70db9c2c8cee1c48a28fd5a80
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.Scanner; public class Lshapes { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tests = sc.nextInt(); while(tests-->0) { boolean valid = true; int rows = sc.nextInt(); int columns = sc.nextInt(); //create and fill the array char[][]...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
04ff8f982c3fb3bc74af5b465746563b
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class F1722 { public static void main(String[] args) { char[][][] valid = new char[][][] { { {'.', '.', '.', '?'}, {'.', '*', '.', '.'}, {'.', '*', '*', '.'}, {'...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
847068302d445e4ff7218e7e39dcf0fe
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; public class Solution { static MyScanner str = new MyScanner(); public static void main(String[] args) throws IOException { int T = i(); wh...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
520137207b882f2531947a80c270628c
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class p5 { BufferedReader br; StringTokenizer st; BufferedWriter bw; public static void main(String[] args)throws Exception { new p5().run(); } void run()throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); bw=new Bu...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
691c9e0a9e725020b8e3c66839b0a326
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Prior...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
74fa25182dc492d889a35986257979c4
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class Coder { static StringBuffer s...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
89613c2e43046b2550e8aedf9c4b9f93
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class f { public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
b0417dd79432c4c71fe027db13cb7d2f
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; import java.io.*; public class Main { static FastReader sc=new FastReader(); static PrintWriter out=new PrintWriter(System.out); static int dx[]={0,0,-1,1,-1,-1,1,1},dy[]={-1,1,0,0,-1,1,-1,1}; static final double pi=3.1415926536; static long mod=1000000007; // static long mod=9982...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
64462e0eec4a718fb096128444fc7e52
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.PriorityQueue; import java.util.StringTokenizer; import java.util.stream.Collectors; public class R817F { static Bu...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d59f0a7dbb9a7dfbcd5d22fe86bffaa0
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static Solution2 admin = new Solution2(); public static void main(String[] args) { admin.start(); } } class Solution2 { //---------------------------------INPUT READER-----------------------------------------// pub...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d1a5240a5f9b45148f16f151044dd196
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
//package codeforce.div4.r817; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Collections; import java....
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
3417f9af3e3ccaf26c9793f334db5761
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; import java.util.Map.Entry; import javax.swing.text.StyledEditorKit.BoldAction; import java.io.*; import java.lang.*; public class main1{ FastScanner in; PrintWriter out; public static void main(String[] arg) { new main1().run(); } ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
344fc1805226d9d52b15ce87cba7e28a
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
// OM NAMAH SHIVAY import java.math.BigInteger; import java.util.*; import java.io.*; public class Vaibhav { static long bit[]; static boolean prime[]; static class Pair implements Comparable<Pair> { long x; int y; Pair(long x, int y) { this.x = x; ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d9ba6ad7d9ee13eda5d6afe33965368c
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; import java.io.*; public class codeforces1722F { static int count; static char [][] arr; static boolean [][] visited; public static void main(String[] args) throws Exception { FastScanner in = new FastScanner(); PrintWriter pw = new PrintWriter(System.out); ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
227d1281bc144a586132341a49f222ac
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
// Mahakal // Remainder: Agar ni ban raha to demotivate ni hona. Yehi chance hai sikhne ka. import java.util.*; import java.io.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.Strin...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
a2428dec8ca1eb341c7ac91803ca423b
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws IOException { int t = ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
df4dd677659bb888c88d4d90cc0dbafb
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { // static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStream...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
ca1101757e23a7912d6e88aee848c427
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class CF1 { static FastReader sc=new FastReader(); // static long dp[][]; // static boolean v[][][]; // static int mod=998244353;; // static int mod=1000000007; static long oset[]; static int oset_p; static long...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
a645e0e914e9838df023075e60bbe160
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class CodeForces { /*-------------------------------------------EDITING CODE STARTS HERE-------------------------------------------*/ public static void solve(int tCase) throws IOException { int n = sc.nextInt(); int m =sc.nextInt(); char[][...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
78c360365aea79ca05f92bcfca49d7ad
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class F { static boolean[][] vis; static char[][] arr; static int n; static int m; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
0e6943e6af9fba7241f076107cd57d87
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.StringTokenizer;...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
3133609e8283ac0bf6b0d3e6e821b048
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedOutputStream; 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.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; impo...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c70223379c307c5d988b022e6b10eb92
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; import java.util.spi.CalendarDataProvider; import javax.imageio.metadata.IIOInvalidTreeException; import java.lang.*; import java.sql.Array; // import java.lang.invoke.ConstantBootstraps; // import java.math.BigInteger; // import java.beans.IndexedPropertyChangeEvent; import java.io.*; ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c7c2b3b58ba9b27c95d5b27c3a063d1a
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class ProblemC { static boolean ok = true; static int count = 0; public static void main(String[] args) throws Exception { Scanner in = new Scanner(); StringBuilder sb = new StringBuilder(); int test = in.readInt(); while(test-->0){ int n = in.re...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
eebd61df87329f82ba676fa1cdc73b5d
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class HarHarShambhu{ static Scanner in=new Scanner(); static long systemTime; static long mod = 1000000007; //static ArrayList<ArrayList<Integer>> adj; static int seive[]=new int[1000001]; sta...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4f06795492200ca1c4d4be9a2bfd330d
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { static int N = 1010; static int n, m; static int[][] g; static int[] p; static int[][] dir = new int[][]{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {-1, 1}, {1, -1}, {-1, -1}}; static boolean ans = t...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
9656de8db438ff738c23f38ac56b40ef
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); static Scanner sc = new Scanner(System.in); public static void main(String[] args) thro...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
7bec8e156f0620f1b000198240c8c161
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.IOException; import java.io.PrintWriter; import java.util.Scanner; public class f { static char[][] arr; static final int[] dx = {-1, 0, 1, 0}; static final int[] dy = {0, 1, 0, -1}; static final int[] dx2 = {-1, -1, 0, 1, 1, 1, 0, -1}; static final int[] dy2 = {0, 1, 1, 1, 0, -1, -1, -...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4774f3bd471f144002be6822d66b8c6e
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader( new InputStreamReader(System.in)); } String ne...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c0c517873de097298f463a483287614e
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; import java.io.*; public class C{ static boolean solve(char c[][]){ int n=c.length; int m=c[0].length; boolean vis[][]=new boolean[n][m]; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(!vis[i][j] && c[i][j]=='*'){ i...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
3147904e5b82628c7f84c0e9becb0bcc
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class B { static boolean[][] checked; public static void main(String[] args) { FastScanner sc = new FastScanner(); int t = sc.nextInt()...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
687d514c7f7eef0074db625ac14f9516
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.util.*; public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws IOException { int t = ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
df2528cec792c1472fe78ca13c366f62
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class q1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = Integer.parseInt(sc.next()); while(t-->0){ int ...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e483015c30522e87b791a046ebacc4eb
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class Main { static class FastScanner// 用于快速读入大量数据 { static BufferedReader br; static StringTokenizer st; public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in), 16384); eat(""); } pu...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
832338f9683bc8dd9d44bcced3716630
train_109.jsonl
1661871000
An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: ...
256 megabytes
import java.util.*; public class CodeForce { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int caseNum = scanner.nextInt(); while(caseNum > 0){ int row = scanner.nextInt(); int col = scanner.nextInt(); scann...
Java
["10\n\n6 10\n\n........**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n6 10\n\n....*...**\n\n.**......*\n\n..*..*....\n\n.....**...\n\n...*.....*\n\n..**....**\n\n3 3\n\n...\n\n***\n\n...\n\n4 4\n\n.*..\n\n**..\n\n..**\n\n..*.\n\n5 4\n\n.*..\n\n**..\n\n....\n\n..**\n\n..*.\n\n3 2\n\n.*\n\n*...
1 second
["YES\nNO\nNO\nNO\nYES\nNO\nNO\nYES\nNO\nNO"]
null
Java 8
standard input
[ "dfs and similar", "implementation" ]
6a06ad39dbdd97ca8654023009c89a42
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 50$$$) — the number of rows and columns i...
1,700
For each test case, output "YES" if the grid is made up of L-shape that don't share edges or corners, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output