← Home
For problem statement at 0-999/700-799/710-719/718/problemA.txt this is a correct solution, but verifier at 0-999/700-799/710-719/718/verifierA.go ends with All 100 tests passed can you fix the verifier? ```go
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 1024*1024), 1024*1024)
	scanner.Split(bufio.ScanWords)

	if !scanner.Scan() {
		return
	}

	if !scanner.Scan() {
		return
	}
	t, _ := strconv.Atoi(scanner.Text())

	if !scanner.Scan() {
		return
	}
	str := []byte(scanner.Text())

	dot_index := -1
	pos := -1
	for i, c := range str {
		if c == '.' {
			dot_index = i
		} else if dot_index != -1 && pos == -1 && c >= '5' {
			pos = i
			break
		}
	}

	if pos == -1 {
		fmt.Println(string(str))
		return
	}

	length := len(str)

	for t > 0 && pos > dot_index && str[pos] >= '5' {
		t--
		length = pos
		p := pos - 1
		for p >= 0 {
			if str[p] == '.' {
				p--
				continue
			}
			if str[p] == '9' {
				str[p] = '0'
				p--
			} else {
				str[p]++
				break
			}
		}
		if p < 0 {
			str = append([]byte{'1'}, str...)
			dot_index++
			length++
			pos++
			p = 0
		}
		if p > dot_index && str[p] >= '5' {
			pos = p
		} else {
			break
		}
	}

	res := str[:length]
	has_dot := false
	for _, c := range res {
		if c == '.' {
			has_dot = true
			break
		}
	}

	if has_dot {
		for len(res) > 0 && res[len(res)-1] == '0' {
			res = res[:len(res)-1]
		}
		if len(res) > 0 && res[len(res)-1] == '.' {
			res = res[:len(res)-1]
		}
	}

	fmt.Println(string(res))
}
```