結果

問題 No.610 区間賞(Section Award)
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2017-12-11 18:18:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 266 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 11,304 KB
実行使用メモリ 33,640 KB
最終ジャッジ日時 2023-08-20 10:07:43
合計ジャッジ時間 8,713 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,124 KB
testcase_01 AC 80 ms
15,120 KB
testcase_02 AC 80 ms
15,120 KB
testcase_03 AC 81 ms
15,236 KB
testcase_04 AC 81 ms
15,024 KB
testcase_05 AC 83 ms
15,028 KB
testcase_06 AC 82 ms
15,148 KB
testcase_07 AC 81 ms
15,288 KB
testcase_08 AC 84 ms
15,316 KB
testcase_09 AC 82 ms
15,232 KB
testcase_10 AC 85 ms
15,268 KB
testcase_11 AC 84 ms
15,232 KB
testcase_12 AC 82 ms
15,080 KB
testcase_13 AC 83 ms
15,116 KB
testcase_14 AC 84 ms
15,264 KB
testcase_15 AC 82 ms
15,020 KB
testcase_16 AC 84 ms
15,268 KB
testcase_17 AC 85 ms
15,116 KB
testcase_18 AC 81 ms
15,296 KB
testcase_19 AC 99 ms
16,572 KB
testcase_20 AC 179 ms
28,536 KB
testcase_21 AC 94 ms
16,452 KB
testcase_22 AC 139 ms
24,064 KB
testcase_23 AC 87 ms
15,500 KB
testcase_24 AC 102 ms
16,932 KB
testcase_25 AC 85 ms
15,340 KB
testcase_26 AC 122 ms
21,080 KB
testcase_27 AC 171 ms
28,556 KB
testcase_28 AC 157 ms
22,708 KB
testcase_29 AC 135 ms
23,448 KB
testcase_30 AC 151 ms
22,208 KB
testcase_31 AC 118 ms
20,616 KB
testcase_32 AC 159 ms
22,968 KB
testcase_33 AC 92 ms
16,576 KB
testcase_34 AC 174 ms
28,540 KB
testcase_35 AC 122 ms
21,292 KB
testcase_36 AC 170 ms
27,964 KB
testcase_37 AC 150 ms
22,264 KB
testcase_38 AC 101 ms
16,668 KB
testcase_39 AC 178 ms
28,708 KB
testcase_40 AC 172 ms
28,976 KB
testcase_41 AC 174 ms
28,704 KB
testcase_42 AC 175 ms
28,944 KB
testcase_43 AC 177 ms
28,924 KB
testcase_44 AC 228 ms
24,880 KB
testcase_45 AC 263 ms
33,592 KB
testcase_46 AC 266 ms
33,640 KB
testcase_47 AC 154 ms
22,516 KB
testcase_48 AC 149 ms
21,512 KB
testcase_49 AC 154 ms
22,312 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