grid search
-
I know the brute force method. can someone help me find a good solution!! Input Format The first line contains an integer, T, which is the number of test cases. T test cases follow, each having a structure as described below: The first line contains two space-separated integers, R and C, indicating the number of rows and columns in the grid G, respectively. This is followed by R lines, each with a string of C digits, which represent the grid G. The following line contains two tab-separated integers, r and c, indicating the number of rows and columns in the pattern grid P. This is followed by r lines, each with a string of c digits, which represent the pattern P. Constraints 1≤T≤5 1≤R,r,C,c≤1000 1≤r≤R 1≤c≤C example INPUT 2 10 10 7283455864 6731158619 8988242643 3830589324 2229505813 5633845374 6473530293 7053106601 0834282956 4607924137 3 4 9505 3845 3530 15 15 400453592126560 114213133098692 474386082879648 522356951189169 887109450487496 252802633388782 502771484966748 075975207693780 511799789562806 404007454272504 549043809916080 962410809534811 445893523733475 768705303214174 650629270887160 2 2 99 99 output Yes No pls help!!
-
I know the brute force method. can someone help me find a good solution!! Input Format The first line contains an integer, T, which is the number of test cases. T test cases follow, each having a structure as described below: The first line contains two space-separated integers, R and C, indicating the number of rows and columns in the grid G, respectively. This is followed by R lines, each with a string of C digits, which represent the grid G. The following line contains two tab-separated integers, r and c, indicating the number of rows and columns in the pattern grid P. This is followed by r lines, each with a string of c digits, which represent the pattern P. Constraints 1≤T≤5 1≤R,r,C,c≤1000 1≤r≤R 1≤c≤C example INPUT 2 10 10 7283455864 6731158619 8988242643 3830589324 2229505813 5633845374 6473530293 7053106601 0834282956 4607924137 3 4 9505 3845 3530 15 15 400453592126560 114213133098692 474386082879648 522356951189169 887109450487496 252802633388782 502771484966748 075975207693780 511799789562806 404007454272504 549043809916080 962410809534811 445893523733475 768705303214174 650629270887160 2 2 99 99 output Yes No pls help!!
Member 12083453 wrote:
I know the brute force method. can someone help me find a good solution!!
Solution to what problem ? You describe the data used, but not the problem you try to solve.
Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein
-
I know the brute force method. can someone help me find a good solution!! Input Format The first line contains an integer, T, which is the number of test cases. T test cases follow, each having a structure as described below: The first line contains two space-separated integers, R and C, indicating the number of rows and columns in the grid G, respectively. This is followed by R lines, each with a string of C digits, which represent the grid G. The following line contains two tab-separated integers, r and c, indicating the number of rows and columns in the pattern grid P. This is followed by r lines, each with a string of c digits, which represent the pattern P. Constraints 1≤T≤5 1≤R,r,C,c≤1000 1≤r≤R 1≤c≤C example INPUT 2 10 10 7283455864 6731158619 8988242643 3830589324 2229505813 5633845374 6473530293 7053106601 0834282956 4607924137 3 4 9505 3845 3530 15 15 400453592126560 114213133098692 474386082879648 522356951189169 887109450487496 252802633388782 502771484966748 075975207693780 511799789562806 404007454272504 549043809916080 962410809534811 445893523733475 768705303214174 650629270887160 2 2 99 99 output Yes No pls help!!
-
I know the brute force method. can someone help me find a good solution!! Input Format The first line contains an integer, T, which is the number of test cases. T test cases follow, each having a structure as described below: The first line contains two space-separated integers, R and C, indicating the number of rows and columns in the grid G, respectively. This is followed by R lines, each with a string of C digits, which represent the grid G. The following line contains two tab-separated integers, r and c, indicating the number of rows and columns in the pattern grid P. This is followed by r lines, each with a string of c digits, which represent the pattern P. Constraints 1≤T≤5 1≤R,r,C,c≤1000 1≤r≤R 1≤c≤C example INPUT 2 10 10 7283455864 6731158619 8988242643 3830589324 2229505813 5633845374 6473530293 7053106601 0834282956 4607924137 3 4 9505 3845 3530 15 15 400453592126560 114213133098692 474386082879648 522356951189169 887109450487496 252802633388782 502771484966748 075975207693780 511799789562806 404007454272504 549043809916080 962410809534811 445893523733475 768705303214174 650629270887160 2 2 99 99 output Yes No pls help!!
Your description of the data's internal structure does not match the data shown. "The first line contains an integer, T, which is the number of test cases." The data shows #2, but it appears you have four test cases. You need to carefully re-edit the question so your description is clear and the data "matches." What makes you think that this there is an algorithm possible here which is anything beyond a series of steps to read the data and process it into some kind of objects-in-code ? Try posting this question on QA, but only post it when you have code to show, and specific questions.
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.