結果

問題 No.485 方程式のお勉強
ユーザー tanson
提出日時 2025-10-08 00:18:00
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 8,308 ms
コンパイル使用メモリ 689,400 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-08 00:18:09
合計ジャッジ時間 4,717 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

fun readInt () =
    valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)


fun intString n =
    if 0 <= n
    then Int.toString n
    else "-" ^ Int.toString (abs n)


val () =
    let
        val a = readInt ()
        val b = readInt ()

        val ans = if b mod a = 0 then (intString (b div a))
                  else "NO"
    in
        print (ans ^ "\n")
    end
0