結果

問題 No.610 区間賞(Section Award)
ユーザー YosukeKawadaYosukeKawada
提出日時 2018-01-15 10:11:28
言語 Ruby
(3.3.0)
結果
AC  
実行時間 359 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 11,496 KB
実行使用メモリ 55,224 KB
最終ジャッジ日時 2023-08-25 17:12:26
合計ジャッジ時間 11,249 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,280 KB
testcase_01 AC 82 ms
15,220 KB
testcase_02 AC 79 ms
15,264 KB
testcase_03 AC 79 ms
15,260 KB
testcase_04 AC 77 ms
15,240 KB
testcase_05 AC 78 ms
15,256 KB
testcase_06 AC 80 ms
15,128 KB
testcase_07 AC 80 ms
15,112 KB
testcase_08 AC 81 ms
15,276 KB
testcase_09 AC 80 ms
15,024 KB
testcase_10 AC 80 ms
15,172 KB
testcase_11 AC 81 ms
15,328 KB
testcase_12 AC 77 ms
15,156 KB
testcase_13 AC 79 ms
15,272 KB
testcase_14 AC 80 ms
15,132 KB
testcase_15 AC 81 ms
15,220 KB
testcase_16 AC 80 ms
15,076 KB
testcase_17 AC 80 ms
15,200 KB
testcase_18 AC 79 ms
15,296 KB
testcase_19 AC 116 ms
21,392 KB
testcase_20 AC 275 ms
53,332 KB
testcase_21 AC 98 ms
18,792 KB
testcase_22 AC 197 ms
36,444 KB
testcase_23 AC 91 ms
17,752 KB
testcase_24 AC 121 ms
22,164 KB
testcase_25 AC 88 ms
17,160 KB
testcase_26 AC 156 ms
34,728 KB
testcase_27 AC 277 ms
53,464 KB
testcase_28 AC 224 ms
41,864 KB
testcase_29 AC 193 ms
36,392 KB
testcase_30 AC 223 ms
41,036 KB
testcase_31 AC 153 ms
27,944 KB
testcase_32 AC 265 ms
47,028 KB
testcase_33 AC 99 ms
19,104 KB
testcase_34 AC 278 ms
53,324 KB
testcase_35 AC 165 ms
34,544 KB
testcase_36 AC 276 ms
55,224 KB
testcase_37 AC 217 ms
41,204 KB
testcase_38 AC 117 ms
21,108 KB
testcase_39 AC 288 ms
53,352 KB
testcase_40 AC 281 ms
53,352 KB
testcase_41 AC 283 ms
53,480 KB
testcase_42 AC 284 ms
53,476 KB
testcase_43 AC 285 ms
53,360 KB
testcase_44 AC 304 ms
46,216 KB
testcase_45 AC 355 ms
54,684 KB
testcase_46 AC 359 ms
54,836 KB
testcase_47 AC 223 ms
41,092 KB
testcase_48 AC 218 ms
41,444 KB
testcase_49 AC 227 ms
40,848 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = $stdin.gets.chomp.to_i
S = $stdin.gets.chomp.split(" ").map{ |a| a.to_i }
T = $stdin.gets.chomp.split(" ").map{ |a| a.to_i }

runner = Hash[T.map.with_index{ |n,i| [n, { t: i+1 }] }]

preliminary_head = N+1
ans = []

S.reverse.each{ |n|
  if runner[n][:t] < preliminary_head
    ans << n
  end
  preliminary_head = [preliminary_head, runner[n][:t]].min
}

puts ans.sort

0