← Home
For problem statement at 1000-1999/1400-1499/1490-1499/1498/problemE.txt this is a correct solution, but verifier at 1000-1999/1400-1499/1490-1499/1498/verifierE.go ends with expected "Problem E is interactive and cannot be automatically solved.\n" got ""

exit status 1 can you fix the verifier? ```go
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

type House struct {
	id int
	k  int
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	if !scanner.Scan() {
		return
	}
	n, _ := strconv.Atoi(scanner.Text())

	houses := make([]House, n)
	for i := 0; i < n; i++ {
		scanner.Scan()
		k, _ := strconv.Atoi(scanner.Text())
		houses[i] = House{id: i + 1, k: k}
	}

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

	bestDiff := -1
	ansA, ansB := 0, 0

	currentSum := 0
	lastSplit := 0

	for i := 0; i < n; i++ {
		currentSum += houses[i].k
		count := i + 1
		expected := count * (count - 1) / 2

		if currentSum == expected {
			if i-lastSplit+1 >= 2 {
				diff := houses[i].k - houses[lastSplit].k
				if diff > bestDiff {
					bestDiff = diff
					ansA = houses[lastSplit].id
					ansB = houses[i].id
				}
			}
			lastSplit = i + 1
		}
	}

	if bestDiff != -1 {
		fmt.Printf("! %d %d\n", ansA, ansB)
	} else {
		fmt.Println("! 0 0")
	}
	os.Stdout.Sync()
}
```