結果

問題 No.1823 Tricolor Dango
ユーザー maimai
提出日時 2022-01-28 21:30:49
言語 Ruby
(3.2.2)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 11,280 KB
実行使用メモリ 28,508 KB
最終ジャッジ日時 2023-08-28 19:12:42
合計ジャッジ時間 4,727 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,240 KB
testcase_01 AC 128 ms
15,140 KB
testcase_02 AC 127 ms
15,280 KB
testcase_03 AC 128 ms
15,248 KB
testcase_04 AC 105 ms
15,400 KB
testcase_05 AC 105 ms
15,684 KB
testcase_06 AC 105 ms
15,588 KB
testcase_07 AC 102 ms
15,472 KB
testcase_08 AC 100 ms
15,312 KB
testcase_09 AC 103 ms
15,704 KB
testcase_10 AC 103 ms
15,504 KB
testcase_11 AC 107 ms
15,572 KB
testcase_12 AC 100 ms
15,608 KB
testcase_13 AC 105 ms
16,332 KB
testcase_14 AC 105 ms
17,128 KB
testcase_15 AC 101 ms
16,644 KB
testcase_16 AC 92 ms
17,392 KB
testcase_17 AC 92 ms
17,496 KB
testcase_18 AC 110 ms
20,640 KB
testcase_19 AC 153 ms
28,508 KB
testcase_20 AC 107 ms
20,824 KB
testcase_21 AC 114 ms
15,440 KB
testcase_22 AC 126 ms
15,164 KB
testcase_23 AC 108 ms
15,604 KB
testcase_24 AC 115 ms
15,252 KB
testcase_25 AC 127 ms
15,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

def lscan; gets.split.map(&:to_i); end

gets.to_i.times do
  n = gets.to_i
  aa = lscan
  sum = aa.reduce(:+)
  h = sum/3
  if h*3 != sum
    puts 'No'
    next
  end
  if aa.max <= h
    puts 'Yes'
  else
    puts 'No'
  end
end
0