結果

問題 No.405 ローマ数字の腕時計
ユーザー gemmarogemmaro
提出日時 2020-04-15 10:17:19
言語 Elixir
(1.16.2)
結果
AC  
実行時間 602 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 2,516 ms
コンパイル使用メモリ 53,668 KB
実行使用メモリ 50,548 KB
最終ジャッジ日時 2023-09-21 00:45:56
合計ジャッジ時間 19,606 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 570 ms
49,120 KB
testcase_01 AC 576 ms
49,848 KB
testcase_02 AC 573 ms
49,992 KB
testcase_03 AC 584 ms
49,276 KB
testcase_04 AC 579 ms
50,504 KB
testcase_05 AC 570 ms
49,272 KB
testcase_06 AC 602 ms
49,340 KB
testcase_07 AC 582 ms
50,048 KB
testcase_08 AC 571 ms
49,376 KB
testcase_09 AC 591 ms
49,256 KB
testcase_10 AC 588 ms
49,228 KB
testcase_11 AC 587 ms
49,212 KB
testcase_12 AC 575 ms
49,188 KB
testcase_13 AC 592 ms
49,336 KB
testcase_14 AC 584 ms
49,192 KB
testcase_15 AC 596 ms
49,276 KB
testcase_16 AC 579 ms
50,548 KB
testcase_17 AC 573 ms
49,848 KB
testcase_18 AC 577 ms
49,680 KB
testcase_19 AC 574 ms
49,232 KB
testcase_20 AC 579 ms
49,268 KB
testcase_21 AC 580 ms
49,936 KB
testcase_22 AC 571 ms
49,396 KB
testcase_23 AC 564 ms
49,116 KB
testcase_24 AC 572 ms
50,048 KB
testcase_25 AC 575 ms
49,868 KB
testcase_26 AC 571 ms
49,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    IO.read(:line)
    |> String.split()
    |> (fn [s, t] -> [s, t |> String.to_integer()] end).()
    |> solve
    |> IO.puts()
  end

  defp solve([s, t]) do
    r()
    |> Enum.at(
      (t +
         (r()
          |> Enum.find_index(&(&1 == s))))
      |> rem(12)
    )
  end

  defp r do
    ~w(I II III IIII V VI VII VIII IX X XI XII)
  end
end
0