結果

問題 No.610 区間賞(Section Award)
ユーザー yuruhiyayuruhiya
提出日時 2021-01-31 14:17:22
言語 Crystal
(1.11.2)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 18,123 ms
コンパイル使用メモリ 257,976 KB
実行使用メモリ 16,600 KB
最終ジャッジ日時 2023-09-13 13:28:10
合計ジャッジ時間 21,439 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 3 ms
4,540 KB
testcase_09 AC 3 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 3 ms
4,432 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 3 ms
4,376 KB
testcase_19 AC 8 ms
6,516 KB
testcase_20 AC 26 ms
14,976 KB
testcase_21 AC 6 ms
6,080 KB
testcase_22 AC 18 ms
12,704 KB
testcase_23 AC 4 ms
5,348 KB
testcase_24 AC 9 ms
7,204 KB
testcase_25 AC 4 ms
4,972 KB
testcase_26 AC 14 ms
9,716 KB
testcase_27 AC 24 ms
14,816 KB
testcase_28 AC 25 ms
14,596 KB
testcase_29 AC 17 ms
11,492 KB
testcase_30 AC 22 ms
13,788 KB
testcase_31 AC 12 ms
8,612 KB
testcase_32 AC 24 ms
14,960 KB
testcase_33 AC 6 ms
5,944 KB
testcase_34 AC 25 ms
14,788 KB
testcase_35 AC 14 ms
9,940 KB
testcase_36 AC 25 ms
14,760 KB
testcase_37 AC 21 ms
12,596 KB
testcase_38 AC 9 ms
6,728 KB
testcase_39 AC 28 ms
16,600 KB
testcase_40 AC 29 ms
16,528 KB
testcase_41 AC 28 ms
16,496 KB
testcase_42 AC 29 ms
16,336 KB
testcase_43 AC 28 ms
16,528 KB
testcase_44 AC 38 ms
15,676 KB
testcase_45 AC 42 ms
14,800 KB
testcase_46 AC 42 ms
14,748 KB
testcase_47 AC 23 ms
14,960 KB
testcase_48 AC 20 ms
12,580 KB
testcase_49 AC 23 ms
15,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

lib C
  fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64
end

class String
  def to_i64
    C.strtoll(self, nil, 10)
  end
end

n = read_line.to_i
a = read_line.split.map(&.to_i.pred)
b = read_line.split.map(&.to_i.pred)
bi = [-1] * n
b.each_with_index { |val, ind| bi[val] = ind }
c = a.map { |i| bi[i] }
min = n
puts a.map { |i| bi[i] }.reverse.select { |i|
  res = min > i
  min = {min, i}.min
  res
}.map { |i| b[i] + 1 }.sort.join('\n')
0