結果

問題 No.610 区間賞(Section Award)
ユーザー YosukeKawadaYosukeKawada
提出日時 2017-12-29 10:38:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 382 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 11,552 KB
実行使用メモリ 34,880 KB
最終ジャッジ日時 2023-08-23 08:56:01
合計ジャッジ時間 11,819 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,344 KB
testcase_01 AC 85 ms
15,148 KB
testcase_02 AC 82 ms
15,232 KB
testcase_03 AC 79 ms
15,024 KB
testcase_04 AC 78 ms
15,040 KB
testcase_05 AC 78 ms
15,152 KB
testcase_06 AC 81 ms
15,036 KB
testcase_07 AC 81 ms
15,024 KB
testcase_08 AC 82 ms
15,296 KB
testcase_09 AC 81 ms
15,288 KB
testcase_10 AC 82 ms
15,152 KB
testcase_11 AC 82 ms
15,144 KB
testcase_12 AC 79 ms
15,072 KB
testcase_13 AC 81 ms
15,148 KB
testcase_14 AC 84 ms
15,132 KB
testcase_15 AC 82 ms
15,252 KB
testcase_16 AC 83 ms
15,284 KB
testcase_17 AC 84 ms
15,144 KB
testcase_18 AC 84 ms
15,148 KB
testcase_19 AC 119 ms
18,780 KB
testcase_20 AC 287 ms
34,076 KB
testcase_21 AC 108 ms
17,972 KB
testcase_22 AC 204 ms
26,704 KB
testcase_23 AC 96 ms
17,032 KB
testcase_24 AC 123 ms
18,588 KB
testcase_25 AC 90 ms
16,224 KB
testcase_26 AC 163 ms
24,768 KB
testcase_27 AC 290 ms
34,060 KB
testcase_28 AC 254 ms
33,628 KB
testcase_29 AC 198 ms
26,560 KB
testcase_30 AC 240 ms
27,480 KB
testcase_31 AC 157 ms
21,320 KB
testcase_32 AC 268 ms
34,880 KB
testcase_33 AC 108 ms
18,224 KB
testcase_34 AC 289 ms
33,952 KB
testcase_35 AC 172 ms
24,892 KB
testcase_36 AC 279 ms
33,836 KB
testcase_37 AC 235 ms
27,356 KB
testcase_38 AC 119 ms
18,676 KB
testcase_39 AC 290 ms
34,400 KB
testcase_40 AC 290 ms
34,192 KB
testcase_41 AC 290 ms
34,444 KB
testcase_42 AC 287 ms
34,448 KB
testcase_43 AC 293 ms
34,180 KB
testcase_44 AC 318 ms
32,900 KB
testcase_45 AC 363 ms
33,872 KB
testcase_46 AC 382 ms
34,324 KB
testcase_47 AC 255 ms
33,284 KB
testcase_48 AC 232 ms
27,340 KB
testcase_49 AC 252 ms
33,520 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: assigned but unused variable - s
Syntax OK

ソースコード

diff #

N     = $stdin.gets.chomp.to_i
place = (0...N).map{ |i| [i+1,0,0] }
$stdin.gets.chomp.split(" ").map{ |a| a.to_i }.each_with_index{ |s,i| place[s-1][1] = i+1 }
$stdin.gets.chomp.split(" ").map{ |a| a.to_i }.each_with_index{ |g,i| place[g-1][2] = i+1 }

g_min = N+1
ans = []
place.sort_by{ |e| e[1] }.reverse.each { |e|
  n,s,g = *e
  if g <= g_min
    ans << n
  end
  g_min = [g_min, g].min
}

puts ans.sort
0