結果
| 問題 |
No.1823 Tricolor Dango
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-07-04 09:25:11 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 202 ms / 2,000 ms |
| コード長 | 263 bytes |
| コンパイル時間 | 38 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 29,184 KB |
| 最終ジャッジ日時 | 2024-07-18 05:52:25 |
| 合計ジャッジ時間 | 4,308 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n Syntax OK
ソースコード
def f()
n=gets.to_i
xs=gets.split(" ").map{|e| e.to_i}.sort.reverse
s3=xs.sum
return "No" if s3%3!=0
s2=s3/3*2
s1=s3/3
sum1=0
xs.each{|x|
m1=s1
if sum1>=s2 then
m1=s3-sum1
end
return "No" if m1<x
sum1+=x
}
return "Yes"
end
t=gets.to_i
t.times{
puts f()
}
horiesiniti