← Home
For problem statement at 1000-1999/1900-1999/1930-1939/1937/problemB.txt this is a correct solution, but verifier at 1000-1999/1900-1999/1930-1939/1937/verifierB.go ends with case 1 failed: reference failed: runtime error: exec: "refB.bin": executable file not found in $PATH

input:
1
19
0110101000010000100
0001001111010100001
exit status 1 can you fix the verifier? ```go
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		var a0 string
		fmt.Fscan(in, &a0)
		var a1 string
		fmt.Fscan(in, &a1)
		var str []byte
		curr_min := 0
		curr_max := n - 1
		var broke bool
		for p := 0; p <= n; p++ {
			if broke {
				break
			}
			has_low := curr_min < p
			has_high := curr_max >= p
			if p == 0 {
				str = append(str, a0[0])
				continue
			}
			var vB byte
			if has_low {
				vB = a1[p-1]
			}
			var vA byte
			if has_high {
				vA = a0[p]
			}
			var m byte = '2'
			if has_low {
				if vB < m {
					m = vB
				}
			}
			if has_high {
				if vA < m {
					m = vA
				}
			}
			str = append(str, m)
			take_low := has_low && vB == m
			take_high := has_high && vA == m
			if take_low && take_high {
			} else if take_low {
				if curr_max > p-1 {
					curr_max = p - 1
				}
				broke = true
				for q := p + 1; q <= n; q++ {
					str = append(str, a1[q-1])
				}
			} else if take_high {
				if curr_min < p {
					curr_min = p
				}
			} else {
				panic("impossible")
			}
		}
		var count int64
		if curr_min <= curr_max {
			count = int64(curr_max - curr_min + 1)
		} else {
			count = 0
		}
		fmt.Println(string(str))
		fmt.Println(count)
	}
}
```