java - Queen Collision -
i solving queen collision problem can located here
i need understanding instructions. understand reading file, don't understand how know queen positions are?
i don't understand part:
the first line of dataset contains blank separated positive integers n g, n indicates n x n board size, , g number of linear patterns of queens described, n < 30000, , g < 250. next g lines each contain 5 blank separated integers, k x y s t, representing linear pattern of k queens @ locations (x + i*s, y +i*t), = 0, 1, ..., k-1. value of k positive. if k 1, values of s , t irrelevant, , given 0. queen positions on board. total number of queen positions among linear patterns no more n, , these queen positions distinct.
the first line of dataset contains blank separated positive integers n g, n indicates n x n board size, , g number of linear patterns of queens described, n < 30000, , g < 250. the next g lines each contain 5 blank separated integers, k x y s t, representing linear pattern of k queens @ locations (x + i*s, y +i*t), = 0, 1, ..., k-1. value of k positive. if k 1, values of s , t irrelevant, , given 0. queen positions on board. total number of queen positions among linear patterns no more n, , these queen positions distinct.
you read g
on first line, , tells how many more lines there are. on each of lines, read k
, x
, y
, s
, t
, , use position queens. k
tells how many queens position set, x
, y
tell position first one, , s
, t
tell distance between queens. don't see how there's difficult understand this.
Comments
Post a Comment