← Home
For problem statement at 1000-1999/1600-1699/1680-1689/1687/problemB.txt this is a correct solution, but verifier at 1000-1999/1600-1699/1680-1689/1687/verifierB.go ends with Problem B is interactive and cannot be automatically verified. can you fix the verifier? ```go
package main

import (
	"fmt"
	"sort"
)

type Edge struct {
	id     int
	weight int
}

func main() {
	var n, m int
	if _, err := fmt.Scan(&n, &m); err != nil {
		return
	}

	edges := make([]Edge, m)
	for i := 0; i < m; i++ {
		q := make([]byte, m)
		for j := 0; j < m; j++ {
			if i == j {
				q[j] = '1'
			} else {
				q[j] = '0'
			}
		}
		fmt.Printf("? %s\n", string(q))
		var w int
		fmt.Scan(&w)
		edges[i] = Edge{id: i, weight: w}
	}

	sort.Slice(edges, func(i, j int) bool {
		return edges[i].weight < edges[j].weight
	})

	ans := 0
	currentS := make([]byte, m)
	for i := 0; i < m; i++ {
		currentS[i] = '0'
	}

	for _, e := range edges {
		if e.weight == 0 {
			continue
		}
		currentS[e.id] = '1'
		fmt.Printf("? %s\n", string(currentS))
		var res int
		fmt.Scan(&res)
		if res == ans+e.weight {
			ans += e.weight
		} else {
			currentS[e.id] = '0'
		}
	}

	fmt.Printf("! %d\n", ans)
}
```