結果

問題 No.2624 Prediction by Average
ユーザー halshals
提出日時 2024-02-29 18:50:05
言語 Julia
(1.10.2)
結果
WA  
実行時間 -
コード長 889 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 7,068 KB
実行使用メモリ 257,724 KB
最終ジャッジ日時 2024-04-09 14:36:41
合計ジャッジ時間 3,858 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 422 ms
254,288 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 415 ms
254,272 KB
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

function main()
    t = int(input())
    ns = [inputs() for _ = 1:t]
    for (n_, s_) = ns
        n = int(n_)
        seisu, syosu = int(split(s_, "."))
        if syosu == 0
            println(n)
            continue
        end
        bottom, up = floor(Int, 1000 / (syosu + 1)), floor(Int, 1000 / syosu)
        # println(bottom, " to ", up)
        println(n ÷ up * (up - bottom) + max(0, n - n ÷ up * up - bottom))
    end
end
# --------input func----------
input() = readline()
inputs() = split(readline())
int(s::AbstractChar) = parse(Int, s)
int(s::AbstractString) = parse(Int, s)
int(v::AbstractArray) = map(x -> parse(Int, x), v)
debug(x...) = println(stderr, x...)
function _main()
    isequal(abspath(PROGRAM_FILE), @__FILE__) && return main()
    mystdin = joinpath(abspath(@__DIR__), "myinput.txt")
    redirect_stdio(stdin=mystdin) do
        main()
    end
end
_main()
0