結果

問題 No.1157 Many Quotients easy
ユーザー tanson
提出日時 2026-01-07 03:27:53
言語 Standard ML
(MLton 20241230)
コンパイル:
mlton_wrapper _filename_
実行:
./main
結果
AC  
実行時間 1 ms / 2,000 ms
+ 146µs
コード長 739 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,800 ms
コンパイル使用メモリ 704,780 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-20 02:14:17
合計ジャッジ時間 6,451 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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



val () =
    let
        val n = readInt ()

        val isUsed = Array.array (n + 1, false)

        fun findAnsAux k =
            if n < k then ignore ()
            else
                (
                  Array.update (isUsed, n div k, true);
                  findAnsAux (k + 1)
                )

        fun findAns () =
            (
              findAnsAux 1;
              Array.foldl (fn (b, acc) => if b = true then acc + 1
                                          else acc)
                           0
                           isUsed
            )
        val ans = findAns ()
    in
        print (Int.toString ans ^ "\n")
    end
0