結果

問題 No.1823 Tricolor Dango
ユーザー simansiman
提出日時 2022-01-30 10:06:55
言語 Ruby
(3.3.0)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 669 ms
コンパイル使用メモリ 11,616 KB
実行使用メモリ 28,604 KB
最終ジャッジ日時 2023-09-02 01:30:31
合計ジャッジ時間 5,383 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,288 KB
testcase_01 AC 132 ms
15,304 KB
testcase_02 AC 134 ms
15,432 KB
testcase_03 AC 134 ms
15,248 KB
testcase_04 AC 113 ms
15,756 KB
testcase_05 AC 112 ms
15,708 KB
testcase_06 AC 112 ms
15,560 KB
testcase_07 AC 109 ms
15,684 KB
testcase_08 AC 107 ms
15,492 KB
testcase_09 AC 111 ms
15,792 KB
testcase_10 AC 108 ms
15,456 KB
testcase_11 AC 108 ms
15,892 KB
testcase_12 AC 103 ms
15,672 KB
testcase_13 AC 112 ms
16,820 KB
testcase_14 AC 112 ms
17,312 KB
testcase_15 AC 107 ms
17,176 KB
testcase_16 AC 99 ms
17,352 KB
testcase_17 AC 98 ms
17,512 KB
testcase_18 AC 117 ms
20,788 KB
testcase_19 AC 162 ms
28,604 KB
testcase_20 AC 113 ms
20,808 KB
testcase_21 AC 119 ms
15,376 KB
testcase_22 AC 130 ms
15,216 KB
testcase_23 AC 112 ms
15,420 KB
testcase_24 AC 118 ms
15,364 KB
testcase_25 AC 130 ms
15,224 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

T = gets.to_i

T.times do
  n = gets.to_i
  a = gets.split.map(&:to_i)
  s = a.sum

  if s % 3 != 0
    puts 'No'
  else
    v = s / 3
    m = a.max

    if m <= v
      puts 'Yes'
    else
      puts 'No'
    end
  end
end
0