結果

問題 No.3259 C++ → Rust → Python
ユーザー tanson
提出日時 2025-09-26 00:29:23
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 861 bytes
コンパイル時間 4,441 ms
コンパイル使用メモリ 686,968 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-26 00:29:29
合計ジャッジ時間 5,090 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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


fun findAns l r =
    let
        fun findAnsLoop limit current arr =
            if current = limit
            then Array.foldl (fn (x, acc) => if x = true then acc + 1 else acc) 0 arr
            else
                (
                  if 1 <= current andalso current <= 295 then Array.update (arr, 0, true)
                  else if 296 <= current andalso current <= 416 then Array.update (arr, 1, true)
                  else Array.update (arr, 2, true);
                  findAnsLoop limit (current + 1) arr         
                )
    in
        findAnsLoop (r + 1) l (Array.array (3, false)) - 1
    end


val () =
    let
        val l = readInt ()
        val r = readInt ()
        val ans = findAns l r
    in
        print (Int.toString ans ^ "\n")
    end
0