← Home
For problem statement at 0-999/600-699/610-619/618/problemB.txt this is a correct solution, but verifier at 0-999/600-699/610-619/618/verifierB.go ends with All tests passed can you fix the verifier? package main

import (
	"fmt"
)

func main() {
	var n int
	if _, err := fmt.Scan(&n); err != nil {
		return
	}

	used := make([]bool, n+1)
	ans := make([]int, n)

	for i := 0; i < n; i++ {
		maxVal := 0
		for j := 0; j < n; j++ {
			var a int
			fmt.Scan(&a)
			if a > maxVal {
				maxVal = a
			}
		}
		if !used[maxVal] {
			ans[i] = maxVal
			used[maxVal] = true
		} else {
			ans[i] = n
			used[n] = true
		}
	}

	for i, v := range ans {
		if i > 0 {
			fmt.Print(" ")
		}
		fmt.Print(v)
	}
	fmt.Println()
}