結果

問題 No.128 お年玉(1)
コンテスト
ユーザー 3qvwn
提出日時 2019-07-06 00:14:42
言語 Elixir
(1.19.5)
コンパイル:
elixirc _filename_
実行:
elixir -e Main.main
結果
AC  
実行時間 343 ms / 5,000 ms
コード長 313 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 875 ms
コンパイル使用メモリ 71,896 KB
実行使用メモリ 64,000 KB
最終ジャッジ日時 2026-06-04 14:40:15
合計ジャッジ時間 11,040 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: 0..-4 has a default step of -1, please write 0..-4//-1 instead
  Main.exs:8: Main.new_year_eve/2

ソースコード

diff #
raw source code

defmodule Main do 
  def main do 
    n = IO.gets("") |> String.trim |> String.to_integer
    IO.gets("") |> String.trim |> String.to_integer |> new_year_eve(n) |> IO.puts
  end
  
  def new_year_eve(m,n) do
    div(n,m) |> Integer.digits |> Enum.slice(0..-4) |> Enum.concat([0,0,0]) |> Integer.undigits
  end
end
0