Ad
  • Custom User Avatar

    to find all the possible safe position is helpful.

  • Custom User Avatar

    There is a special algorithm:
    look at c, c is not auto-opened, so c is not 0. that means, there is at least 1 mine around c(or c is a mine).
    So, 1 mine hide between a,d, 1 mine hide between j,l, 1 mine hide between bcef
    g,h,i,k,m are the safe positions, open them, and continue your work ;-)

  • Default User Avatar

    I have encountered a strange random testcase, and since I cannot reproduce it. I want to have a confirmation to the standard answer.

    input:

    ? ? ? ? ? ? 0 0 ? ? ? 0 ? ? ? ? 0 0 ? ? ? ? ? ? ?
    ? ? ? ? ? ? 0 0 ? ? ? 0 ? ? ? ? 0 0 ? ? ? ? ? ? ?
    ? ? ? ? ? 0 0 0 ? ? ? 0 0 ? ? ? ? ? 0 0 ? ? ? ? ?
    0 0 0 0 0 0 0 0 0 0 0 0 ? ? ? ? ? ? 0 0 ? ? ? ? ?
    0 0 0 0 0 0 0 0 0 0 0 0 ? ? ? ? ? ? 0 0 0 ? ? ? ?
    0 0 0 0 0 0 0 0 0 0 0 0 ? ? ? 0 0 0 0 0 0 0 ? ? ?
    

    The standard answer as I have recorded:
    (if the actual output is '?', then this issue could be closed)

    1 1 1 2 x 1 0 0 1 1 1 0 1 x 2 1 0 0 1 x 1 1 2 x 1
    x 1 1 x 2 1 0 0 1 x 1 0 1 2 x 1 0 0 1 1 2 2 x 2 1
    1 1 1 1 1 0 0 0 1 1 1 0 0 1 1 2 1 1 0 0 1 x 4 3 1
    0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 x 1 0 0 1 2 x x 1
    0 0 0 0 0 0 0 0 0 0 0 0 1 x 1 1 1 1 0 0 0 1 3 3 2
    0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 x 1 
    

    My solver (and verifed myself) can only make this far:

    1 1 1 2 x 1 0 0 1 1 1 0 1 x 2 1 0 0 1 x 1 1 ? ? ?
    x 1 1 x 2 1 0 0 1 x 1 0 1 2 x 1 0 0 1 1 2 2 ? ? ?
    1 1 1 1 1 0 0 0 1 1 1 0 0 1 1 2 1 1 0 0 1 x 4 ? ?
    0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 x 1 0 0 1 2 x x ?
    0 0 0 0 0 0 0 0 0 0 0 0 1 x 1 1 1 1 0 0 0 1 3 ? ?
    0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 ? ?
    

    And 3 mines left.

    And my solve tell me that there are 18 valid solutions:

    let's strip the right-most 5 columns and give the unknowns some names for illustration:

    1 1 a b c
    2 2 d e f
    1 x 4 g h
    1 2 x x i
    0 1 3 j k
    0 0 1 l m
    

    All possible solutions:

    1:  (a,e,j)
    2:  (a,e,l)
    3:  (a,g,j)
    4:  (a,g,l)
    5:  (b,d,j)
    6:  (b,d,l)
    7:  (c,d,j)
    8:  (c,d,l)
    9:  (d,f,j)
    10: (d,f,l)
    11: (d,h,j)
    12: (d,h,l)
    13: (d,i,j)
    14: (d,i,l)
    15: (d,j,k)
    16: (d,j,m)
    17: (d,k,l)
    18: (d,l,m)
    

    Because these solutions cover all possible positions of mine, so there is no positions to open.
    And because there is no single position that appear in all solution, there is no ways to mark as mine.