Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. grid search

grid search

Scheduled Pinned Locked Moved Algorithms
cssregexhelptutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 12049999
    wrote on last edited by
    #1

    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!!

    P L B 3 Replies Last reply
    0
    • U User 12049999

      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!!

      P Offline
      P Offline
      Patrice T
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • U User 12049999

        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!!

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        This is quite straightforward. Read the control numbers and extract the remaining data sets based on those numbers.

        1 Reply Last reply
        0
        • U User 12049999

          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!!

          B Offline
          B Offline
          BillWoodruff
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups