← Home
For problem statement at 1000-1999/1200-1299/1270-1279/1270/problemC.txt this is a correct solution, but verifier at 1000-1999/1200-1299/1270-1279/1270/verifierC.go ends with All 9 tests passed can you fix the verifier? package main

import (
	"bytes"
	"io"
	"os"
	"strconv"
)

func main() {
	data, _ := io.ReadAll(os.Stdin)
	idx := 0
	nextInt := func() int64 {
		for idx < len(data) && (data[idx] < '0' || data[idx] > '9') {
			idx++
		}
		var v int64
		for idx < len(data) && data[idx] >= '0' && data[idx] <= '9' {
			v = v*10 + int64(data[idx]-'0')
			idx++
		}
		return v
	}

	t := int(nextInt())
	var out bytes.Buffer

	for ; t > 0; t-- {
		n := int(nextInt())
		var sum, xr int64
		for i := 0; i < n; i++ {
			v := nextInt()
			sum += v
			xr ^= v
		}

		out.WriteString("2\n")
		out.Write(strconv.AppendInt(nil, xr, 10))
		out.WriteByte(' ')
		out.Write(strconv.AppendInt(nil, sum+xr, 10))
		out.WriteByte('\n')
	}

	_, _ = os.Stdout.Write(out.Bytes())
}