← Home
For problem statement at 1000-1999/1400-1499/1490-1499/1491/problemA.txt this is a correct solution, but verifier at 1000-1999/1400-1499/1490-1499/1491/verifierA.go ends with oracle error on case 1: exec: "oracleA.bin": executable file not found in $PATH

exit status 1 can you fix the verifier? package main

import (
	"bufio"
	"os"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	buf := make([]byte, 1024*1024)
	scanner.Buffer(buf, 1024*1024)

	scanInt := func() int {
		scanner.Scan()
		res := 0
		for _, b := range scanner.Bytes() {
			res = res*10 + int(b-'0')
		}
		return res
	}

	n := scanInt()
	q := scanInt()

	a := make([]int, n+1)
	ones := 0
	for i := 1; i <= n; i++ {
		a[i] = scanInt()
		if a[i] == 1 {
			ones++
		}
	}

	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	for i := 0; i < q; i++ {
		t := scanInt()
		if t == 1 {
			x := scanInt()
			if a[x] == 1 {
				ones--
				a[x] = 0
			} else {
				ones++
				a[x] = 1
			}
		} else {
			k := scanInt()
			if ones >= k {
				writer.WriteString("1\n")
			} else {
				writer.WriteString("0\n")
			}
		}
	}
}