結果

問題 No.216 FAC
ユーザー tsukacchantsukacchan
提出日時 2016-06-28 19:14:23
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-20 03:45:50
合計ジャッジ時間 3,302 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
12,160 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 93 ms
12,288 KB
testcase_04 AC 86 ms
12,160 KB
testcase_05 AC 97 ms
12,160 KB
testcase_06 AC 78 ms
12,160 KB
testcase_07 AC 86 ms
12,288 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 85 ms
12,288 KB
testcase_12 WA -
testcase_13 AC 74 ms
12,160 KB
testcase_14 WA -
testcase_15 AC 78 ms
12,160 KB
testcase_16 AC 88 ms
12,160 KB
testcase_17 AC 86 ms
12,160 KB
testcase_18 WA -
testcase_19 AC 86 ms
12,160 KB
testcase_20 WA -
testcase_21 AC 95 ms
12,160 KB
testcase_22 AC 86 ms
12,416 KB
testcase_23 AC 91 ms
12,160 KB
testcase_24 WA -
testcase_25 AC 87 ms
12,160 KB
testcase_26 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - a
Syntax OK

ソースコード

diff #

N = gets.to_i
a = gets.split(" ").map(&:to_i)
b = gets.split(" ").map(&:to_i)

sum = Array.new(101,0)

#sum[0]はKの合計点。他100人はs[1]~s[100]
(0..100).each{ |i|
    (0..N-1).each{ |j|
        if b[j]==i
            sum[i] += b[j]
        end    
    }
}

if sum[0] >= sum.max
    puts "YES"
else
    puts "NO"
end    
0