結果
| 問題 |
No.1586 Equal Array
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-18 00:13:33 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 1,000 ms |
| コード長 | 933 bytes |
| コンパイル時間 | 14,023 ms |
| コンパイル使用メモリ | 219,936 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 12:53:18 |
| 合計ジャッジ時間 | 15,298 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
// No.1586 Equal Array
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
// func makeDummy(dummy_txt string, n int) {
// rand.Seed(time.Now().UnixNano())
// o, _ := os.Create(dummy_txt)
// defer o.Close()
// fmt.Fprintln(o, n)
// for i := 0; i < n; i++ {
// if i != 0 {
// fmt.Fprint(o, " ")
// }
// //fmt.Fprint(o, 1_000_000_000)
// fmt.Fprint(o, 1+rand.Int()%1_000_000_000)
// }
// fmt.Fprintln(o)
// }
func main() {
// makeDummy("dummy.txt", 100000)
// os.Stdin, _ = os.Open("dummy.txt")
// now := time.Now()
// defer func() { fmt.Println(time.Since(now)) }()
sc := bufio.NewScanner(os.Stdin)
sc.Buffer(make([]byte, 100000*11+2), 100000*11+2)
sc.Scan()
N, _ := strconv.Atoi(sc.Text())
sc.Scan()
ss := strings.Fields(sc.Text())
suma := 0
for _, s := range ss {
a, _ := strconv.Atoi(s)
suma += a
}
if suma%N == 0 {
fmt.Println("Yes")
} else {
fmt.Println("No")
}
}