For problem statement at 0-999/800-899/870-879/870/problemD.txt this is a correct solution, but verifier at 0-999/800-899/870-879/870/verifierD.go ends with All tests passed can you fix the verifier? package main
import (
"fmt"
)
func main() {
var n int
fmt.Scan(&n)
A := make([]int, n)
for i := 0; i < n; i++ {
fmt.Printf("? %d 0\n", i)
fmt.Scan(&A[i])
}
B := make([]int, n)
B[0] = A[0]
for j := 1; j < n; j++ {
fmt.Printf("? 0 %d\n", j)
fmt.Scan(&B[j])
}
var validP []int
count := 0
for p0 := 0; p0 < n; p0++ {
b0 := p0 ^ A[0]
p := make([]int, n)
seen := make([]bool, n)
possible := true
for i := 0; i < n; i++ {
p[i] = A[i] ^ b0
if p[i] >= n || p[i] < 0 || seen[p[i]] {
possible = false
break
}
seen[p[i]] = true
}
if !possible {
continue
}
b := make([]int, n)
for i := 0; i < n; i++ {
b[p[i]] = i
}
for j := 0; j < n; j++ {
if b[j] != B[j]^p0 {
possible = false
break
}
}
if possible {
count++
if count == 1 {
validP = p
}
}
}
fmt.Println("!")
fmt.Println(count)
for i := 0; i < n; i++ {
if i > 0 {
fmt.Print(" ")
}
fmt.Print(validP[i])
}
fmt.Println()
}