結果

問題 No.610 区間賞(Section Award)
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2017-12-11 18:18:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 297 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 32,768 KB
最終ジャッジ日時 2024-05-07 17:08:09
合計ジャッジ時間 9,473 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
12,288 KB
testcase_01 AC 92 ms
12,160 KB
testcase_02 AC 90 ms
12,160 KB
testcase_03 AC 89 ms
12,416 KB
testcase_04 AC 90 ms
12,160 KB
testcase_05 AC 91 ms
12,160 KB
testcase_06 AC 91 ms
12,288 KB
testcase_07 AC 91 ms
12,160 KB
testcase_08 AC 93 ms
12,288 KB
testcase_09 AC 90 ms
12,160 KB
testcase_10 AC 90 ms
12,160 KB
testcase_11 AC 90 ms
12,160 KB
testcase_12 AC 90 ms
12,288 KB
testcase_13 AC 93 ms
12,288 KB
testcase_14 AC 92 ms
12,160 KB
testcase_15 AC 90 ms
12,160 KB
testcase_16 AC 90 ms
12,288 KB
testcase_17 AC 90 ms
12,288 KB
testcase_18 AC 90 ms
12,160 KB
testcase_19 AC 112 ms
14,720 KB
testcase_20 AC 186 ms
26,112 KB
testcase_21 AC 103 ms
13,568 KB
testcase_22 AC 156 ms
21,248 KB
testcase_23 AC 102 ms
12,672 KB
testcase_24 AC 114 ms
15,104 KB
testcase_25 AC 95 ms
12,672 KB
testcase_26 AC 135 ms
16,232 KB
testcase_27 AC 183 ms
25,984 KB
testcase_28 AC 167 ms
23,552 KB
testcase_29 AC 150 ms
20,352 KB
testcase_30 AC 166 ms
22,784 KB
testcase_31 AC 131 ms
16,000 KB
testcase_32 AC 179 ms
24,576 KB
testcase_33 AC 104 ms
13,568 KB
testcase_34 AC 187 ms
25,856 KB
testcase_35 AC 136 ms
16,096 KB
testcase_36 AC 182 ms
24,960 KB
testcase_37 AC 170 ms
22,656 KB
testcase_38 AC 110 ms
14,720 KB
testcase_39 AC 188 ms
26,496 KB
testcase_40 AC 189 ms
26,368 KB
testcase_41 AC 186 ms
26,496 KB
testcase_42 AC 189 ms
26,496 KB
testcase_43 AC 189 ms
26,496 KB
testcase_44 AC 244 ms
25,600 KB
testcase_45 AC 297 ms
32,640 KB
testcase_46 AC 278 ms
32,768 KB
testcase_47 AC 168 ms
23,168 KB
testcase_48 AC 163 ms
22,528 KB
testcase_49 AC 168 ms
23,424 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
s = gets.split.map(&:to_i)
t = gets.split.map(&:to_i)
w = Array.new(n)

s.each_with_index do |v,i|
    w[v] = i
end
ans = []
t.inject(-1) do |m,v|
    if w[v] > m
        ans << v
        w[v]
    else
        m
    end
end
puts ans.sort
0