For problem statement at 1000-1999/1400-1499/1480-1489/1486/problemA.txt this is a correct solution, but verifier at 1000-1999/1400-1499/1480-1489/1486/verifierA.go ends with All 100 tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func main() {
scanner := bufio.NewScanner(os.Stdin)
scanner.Split(bufio.ScanWords)
if !scanner.Scan() {
return
}
t, _ := strconv.Atoi(scanner.Text())
for ; t > 0; t-- {
scanner.Scan()
n, _ := strconv.Atoi(scanner.Text())
sum := int64(0)
possible := true
for i := 0; i < n; i++ {
scanner.Scan()
h, _ := strconv.ParseInt(scanner.Text(), 10, 64)
sum += h
req := int64(i) * int64(i+1) / 2
if sum < req {
possible = false
}
}
if possible {
fmt.Println("YES")
} else {
fmt.Println("NO")
}
}
}