← Home
For problem statement at 1000-1999/1800-1899/1850-1859/1859/problemA.txt this is a correct solution, but verifier at 1000-1999/1800-1899/1850-1859/1859/verifierA.go ends with All tests passed can you fix the verifier? package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	if _, err := fmt.Fscan(in, &t); err != nil {
		return
	}
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		a := make([]int, n)
		min := -1
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &a[j])
			if min == -1 || a[j] < min {
				min = a[j]
			}
		}
		var b, c []int
		for j := 0; j < n; j++ {
			if a[j] == min {
				b = append(b, a[j])
			} else {
				c = append(c, a[j])
			}
		}
		if len(c) == 0 {
			fmt.Fprintln(out, "-1")
		} else {
			fmt.Fprintln(out, len(b), len(c))
			for j, v := range b {
				if j > 0 {
					fmt.Fprint(out, " ")
				}
				fmt.Fprint(out, v)
			}
			fmt.Fprintln(out)
			for j, v := range c {
				if j > 0 {
					fmt.Fprint(out, " ")
				}
				fmt.Fprint(out, v)
			}
			fmt.Fprintln(out)
		}
	}
}