Randomly place p ones in an n x n array of zeros, at p distinct positions
chosen uniformly at random without replacement. Seed the global random state
with seed first: do it inside solve, immediately before the random call,
since the seed is global, shared state.
Input
n = 10, p = 3, seed = 0