結果

問題 No.296 n度寝
ユーザー yukiccoyukicco
提出日時 2018-11-17 22:57:47
言語 Elixir
(1.16.2)
結果
AC  
実行時間 644 ms / 1,000 ms
コード長 484 bytes
コンパイル時間 1,285 ms
コンパイル使用メモリ 55,836 KB
実行使用メモリ 50,308 KB
最終ジャッジ日時 2023-08-29 23:06:05
合計ジャッジ時間 12,661 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 628 ms
49,040 KB
testcase_01 AC 631 ms
49,156 KB
testcase_02 AC 632 ms
49,160 KB
testcase_03 AC 644 ms
49,308 KB
testcase_04 AC 624 ms
49,660 KB
testcase_05 AC 627 ms
49,052 KB
testcase_06 AC 624 ms
49,796 KB
testcase_07 AC 623 ms
49,732 KB
testcase_08 AC 636 ms
49,128 KB
testcase_09 AC 625 ms
49,432 KB
testcase_10 AC 622 ms
49,292 KB
testcase_11 AC 629 ms
50,308 KB
testcase_12 AC 624 ms
48,976 KB
testcase_13 AC 619 ms
49,068 KB
testcase_14 AC 624 ms
49,144 KB
testcase_15 AC 622 ms
49,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
    def toMin(time) do
        {h, m} = time
        (60 * h) + m
    end
    def toTime(min) do
        d = div(min, 1440)
        h = div(min, 60) - (24 * d)
        m = rem(min, 60)
        {h, m}
    end
    def main do

        inputs = IO.binread(:all) |> String.split

        [n, h, m, t] = Enum.map(inputs, &(String.to_integer(&1)))

        {hour, minute} = toMin({h, m}) + (t * (n - 1)) |> toTime

        IO.puts hour
        IO.puts minute

    end
end
0