結果

問題 No.858 わり算
ユーザー むらため
提出日時 2019-09-03 04:55:54
言語 Nim
(2.2.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 3,381 ms
コンパイル使用メモリ 64,624 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-07 14:51:52
合計ジャッジ時間 3,763 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" ,discardable.}
proc scan(): int =
  while true:
    let k = getchar_unlocked()
    if k < '0': return
    result = 10 * result + k.ord - '0'.ord
# 小数点以下p桁
proc arbitraryPrecisionDiv(a,b,p:int):string =
  result = $(a div b) & "."
  var a = a
  for _ in 0..<p:
    a = a mod b
    a *= 10
    result .add $(a div b)
let a = scan()
let b = scan()
echo arbitraryPrecisionDiv(a,b,50)
0