Skip to content

Instantly share code, notes, and snippets.

@hanjae-jea
Created February 3, 2016 11:42
Show Gist options
  • Save hanjae-jea/bb4f05f3717158874223 to your computer and use it in GitHub Desktop.
Save hanjae-jea/bb4f05f3717158874223 to your computer and use it in GitHub Desktop.
import java.io.*;
public class GridSearch{
int R, C, r, c;
String G[], P[];
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int test_case = in.nextInt();
for( int test = 0 ; test < test_case ; test ++){ // T
Boolean result = test(in);
}
}
private Boolean test(Scanner in){
R = in.nextInt();
C = in.nextInt();
G = new String[R];
for(int G_i=0; G_i < R; G_i++){
G[G_i] = in.next();
}
r = in.nextInt();
c = in.nextInt();
P = new String[r];
for(int P_i=0; P_i < r; P_i ++){
P[P_i] = in.next();
}
for( int i = 0; i <= R-r; i ++ ){
int res = G[i].indexOf(P[0]);
if( res > -1 ){
check(G, P, i, res);
}
}
}
private check(String G[], String P[], int row, int col){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment