← Home
For problem statement at 0-999/0-99/30-39/37/problemC.txt this is a correct solution, but verifier at 0-999/0-99/30-39/37/verifierC.go ends with All tests passed can you fix the verifier? ```go
package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"sort"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	var n int
	fmt.Sscan(scanner.Text(), &n)
	lens := make([]int, n)
	scanner.Scan()
	line := scanner.Text()
	wordsS := strings.Split(line, " ")
	for i := 0; i < n; i++ {
		fmt.Sscan(wordsS[i], &lens[i])
	}
	var maxL int
	for _, l := range lens {
		if l > maxL {
			maxL = l
		}
	}
	twoMax := big.NewInt(1)
	twoMax = twoMax.Lsh(twoMax, uint(maxL))
	indices := make([]int, n)
	for i := 0; i < n; i++ {
		indices[i] = i
	}
	sort.Slice(indices, func(i, j int) bool {
		return lens[indices[i]] < lens[indices[j]]
	})
	currentS := big.NewInt(0)
	words := make([]string, n)
	for _, idx := range indices {
		l := lens[idx]
		sizeI := big.NewInt(1)
		sizeI = sizeI.Lsh(sizeI, uint(maxL-l))
		temp := big.NewInt(0).Add(currentS, sizeI)
		if temp.Cmp(twoMax) > 0 {
			fmt.Println("NO")
			return
		}
		divisor := big.NewInt(1)
		divisor = divisor.Lsh(divisor, uint(maxL-l))
		high := big.NewInt(0).Div(currentS, divisor)
		var sb strings.Builder
		for pos := l - 1; pos >= 0; pos-- {
			if high.Bit(pos) != 0 {
				sb.WriteRune('1')
			} else {
				sb.WriteRune('0')
			}
		}
		words[idx] = sb.String()
		currentS.Add(currentS, sizeI)
	}
	fmt.Println("YES")
	for _, w := range words {
		fmt.Println(w)
	}
}
```