結果

問題 No.1823 Tricolor Dango
ユーザー praypray
提出日時 2022-01-29 09:56:48
言語 Go
(1.22.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 422 bytes
コンパイル時間 14,113 ms
コンパイル使用メモリ 206,196 KB
実行使用メモリ 8,236 KB
最終ジャッジ日時 2023-08-30 07:04:52
合計ジャッジ時間 32,558 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 783 ms
8,224 KB
testcase_02 AC 789 ms
8,096 KB
testcase_03 AC 792 ms
8,104 KB
testcase_04 AC 656 ms
8,156 KB
testcase_05 AC 648 ms
8,084 KB
testcase_06 AC 662 ms
8,080 KB
testcase_07 AC 607 ms
7,980 KB
testcase_08 AC 567 ms
7,976 KB
testcase_09 AC 654 ms
8,004 KB
testcase_10 AC 652 ms
7,976 KB
testcase_11 AC 705 ms
7,976 KB
testcase_12 AC 543 ms
7,984 KB
testcase_13 AC 617 ms
7,936 KB
testcase_14 AC 753 ms
7,932 KB
testcase_15 AC 608 ms
7,944 KB
testcase_16 AC 218 ms
5,668 KB
testcase_17 AC 391 ms
5,672 KB
testcase_18 AC 678 ms
7,936 KB
testcase_19 TLE -
testcase_20 AC 660 ms
7,932 KB
testcase_21 AC 690 ms
8,212 KB
testcase_22 AC 766 ms
8,032 KB
testcase_23 AC 674 ms
8,104 KB
testcase_24 AC 709 ms
8,172 KB
testcase_25 AC 760 ms
8,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func main() {
	var T int
	fmt.Scan(&T)
	for i := 0; i < T; i++ {
		var N int
		fmt.Scan(&N)
		A := make([]int, N)
		maxA := 0
		sum := 0
		for i := 0; i < N; i++ {
			fmt.Scan(&A[i])
			sum += A[i]
			maxA = max(maxA, A[i])
		}
		if sum%3 != 0 || sum/3 < maxA {
			fmt.Println("No")
			continue
		}
		fmt.Println("Yes")
	}
}
0