← Home
For problem statement at 1000-1999/1700-1799/1790-1799/1795/problemB.txt this is a correct solution, but verifier at 1000-1999/1700-1799/1790-1799/1795/verifierB.go ends with All tests passed can you fix the verifier? package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(in, &t)

	var out strings.Builder
	for ; t > 0; t-- {
		var n, k int
		fmt.Fscan(in, &n, &k)
		hasL, hasR := false, false
		for i := 0; i < n; i++ {
			var l, r int
			fmt.Fscan(in, &l, &r)
			if l == k {
				hasL = true
			}
			if r == k {
				hasR = true
			}
		}
		if hasL && hasR {
			out.WriteString("YES\n")
		} else {
			out.WriteString("NO\n")
		}
	}

	fmt.Print(out.String())
}