結果

問題 No.610 区間賞(Section Award)
ユーザー YosukeKawadaYosukeKawada
提出日時 2018-01-15 10:19:41
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 464 ms
コンパイル使用メモリ 11,516 KB
実行使用メモリ 55,276 KB
最終ジャッジ日時 2023-08-25 17:12:41
合計ジャッジ時間 11,316 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 78 ms
15,304 KB
testcase_06 AC 81 ms
15,048 KB
testcase_07 AC 80 ms
15,292 KB
testcase_08 AC 81 ms
15,212 KB
testcase_09 AC 81 ms
15,248 KB
testcase_10 AC 82 ms
15,344 KB
testcase_11 AC 83 ms
15,284 KB
testcase_12 AC 79 ms
15,304 KB
testcase_13 AC 81 ms
15,268 KB
testcase_14 AC 80 ms
15,180 KB
testcase_15 AC 81 ms
15,172 KB
testcase_16 AC 80 ms
15,128 KB
testcase_17 AC 80 ms
15,164 KB
testcase_18 AC 82 ms
15,264 KB
testcase_19 AC 119 ms
21,240 KB
testcase_20 AC 313 ms
53,408 KB
testcase_21 AC 102 ms
18,740 KB
testcase_22 AC 228 ms
36,376 KB
testcase_23 AC 95 ms
17,676 KB
testcase_24 AC 127 ms
21,900 KB
testcase_25 AC 89 ms
17,208 KB
testcase_26 AC 167 ms
34,596 KB
testcase_27 AC 302 ms
53,300 KB
testcase_28 AC 254 ms
41,864 KB
testcase_29 AC 206 ms
36,480 KB
testcase_30 AC 255 ms
41,168 KB
testcase_31 AC 161 ms
28,020 KB
testcase_32 AC 294 ms
47,072 KB
testcase_33 AC 101 ms
19,060 KB
testcase_34 AC 305 ms
53,344 KB
testcase_35 AC 169 ms
34,652 KB
testcase_36 AC 305 ms
55,276 KB
testcase_37 AC 239 ms
41,204 KB
testcase_38 AC 120 ms
21,268 KB
testcase_39 AC 311 ms
53,460 KB
testcase_40 AC 331 ms
53,316 KB
testcase_41 AC 312 ms
53,544 KB
testcase_42 AC 307 ms
53,532 KB
testcase_43 AC 314 ms
53,508 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 252 ms
40,984 KB
testcase_48 AC 244 ms
41,296 KB
testcase_49 AC 254 ms
41,116 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:8: warning: assigned but unused variable - ans
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
    runner[n][:ok] = true
  end
  preliminary_head = [preliminary_head, runner[n][:t]].min
}

puts (1...N).select{ |n| runner[n][:ok] }

0