結果

問題 No.318 学学学学学
ユーザー LeonardoneLeonardone
提出日時 2015-12-11 23:29:20
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 432 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 11,284 KB
実行使用メモリ 40,228 KB
最終ジャッジ日時 2023-10-13 11:29:03
合計ジャッジ時間 5,245 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
20,792 KB
testcase_01 AC 119 ms
17,916 KB
testcase_02 AC 125 ms
17,768 KB
testcase_03 AC 108 ms
17,236 KB
testcase_04 AC 119 ms
17,852 KB
testcase_05 AC 326 ms
35,640 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#! ruby
# yukicoder My Practice
# author: Leonardone @ NEETSDKASU

def gs(); gets.chomp; end
def gi(); gets.to_i; end
def gss(); gets.chomp.split; end
def gis(); gss.map(&:to_i); end


n = gi
a = gis

m = {}

n.times do |i|
    k = a[i]
    if m.key? k
        m[k] << i
    else
        m[k] = [i]
    end
end

m.keys.sort.each do |k|
    mn, mx = m[k].minmax
    mn.upto(mx) do |j|
        a[j] = k
    end
end

puts a * " "





0