提出 #68109811


ソースコード 拡げる

function main()
    n, m = int(inputs())
    a = int(inputs())
    b = int(inputs())
    a_ = Dict{Int,Int}()
    for i in a
        a_[i] = get(a_, i, 0) + 1
    end
    for i in 1:m
        if get(a_, b[i], 0) > 0
            a_[b[i]] = max(0, a_[b[i]] - 1)
        end
    end
    ans = []
    for i in keys(a_)
        for j in 1:a_[i]
            push!(ans, i)
        end
    end
    println(join(sort(ans), " "))
end
# --------input func----------

input() = readline()
inputs() = split(readline())
int(s::AbstractChar) = parse(Int, s)
int(s::AbstractString) = parse(Int, s)
int(v::AbstractArray) = parse.(Int, v)
debug(x...) = println(stderr, x...)
isfile("myinput.txt") && (mystdin = open("myinput.txt", "r"); redirect_stdin(mystdin))
main()
@isdefined(mystdin) && close(mystdin)

提出情報

提出日時
問題 B - Search and Delete
ユーザ hals
言語 Julia (Julia 1.9.2)
得点 200
コード長 821 Byte
結果 AC
実行時間 451 ms
メモリ 242644 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 28
セット名 テストケース
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 451 ms 242292 KiB
example_01.txt AC 345 ms 242228 KiB
hand_00.txt AC 343 ms 242572 KiB
hand_01.txt AC 347 ms 242372 KiB
hand_02.txt AC 351 ms 242328 KiB
hand_03.txt AC 351 ms 241908 KiB
hand_04.txt AC 348 ms 242180 KiB
hand_05.txt AC 341 ms 242328 KiB
random_00.txt AC 351 ms 242640 KiB
random_01.txt AC 346 ms 242292 KiB
random_02.txt AC 350 ms 242280 KiB
random_03.txt AC 350 ms 242300 KiB
random_04.txt AC 354 ms 242340 KiB
random_05.txt AC 349 ms 242072 KiB
random_06.txt AC 348 ms 242428 KiB
random_07.txt AC 349 ms 242384 KiB
random_08.txt AC 352 ms 242644 KiB
random_09.txt AC 355 ms 242376 KiB
random_10.txt AC 347 ms 242612 KiB
random_11.txt AC 343 ms 242252 KiB
random_12.txt AC 351 ms 242376 KiB
random_13.txt AC 362 ms 242416 KiB
random_14.txt AC 349 ms 242640 KiB
random_15.txt AC 346 ms 241988 KiB
random_16.txt AC 350 ms 242288 KiB
random_17.txt AC 346 ms 242100 KiB
random_18.txt AC 352 ms 242372 KiB
random_19.txt AC 346 ms 242340 KiB