package mainimport bufio;fmt;os;strconvfunc main reader = bufioNewReaderosStdin l _ _ = readerReadLine var t n s m int t _ = strconvAtoistringl for i = 0; i t; i++ l _ _ = readerReadLine nums = i
package main
import ( "bufio" "fmt" "os" "strconv" "strings" )
func main() { reader := bufio.NewReader(os.Stdin) l, _, _ := reader.ReadLine() t, _ := strconv.Atoi(string(l))
for i := 0; i < t; i++ {
l, _, _ = reader.ReadLine()
numsStr := strings.Split(string(l), " ")
nums := []int{}
for _, numStr := range numsStr {
num, _ := strconv.Atoi(numStr)
nums = append(nums, num)
}
n, s := nums[0], nums[1]
for j := 0; j < n; j++ {
l, _, _ = reader.ReadLine()
num, _ := strconv.Atoi(string(l))
s -= num
}
if s == 0 {
fmt.Println("YES")
} else {
fmt.Println("NO")
}
}
原文地址: http://www.cveoy.top/t/topic/hTyV 著作权归作者所有。请勿转载和采集!