結果

問題 No.104 国道
ユーザー tanson
提出日時 2025-08-25 01:07:53
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 714 bytes
コンパイル時間 4,589 ms
コンパイル使用メモリ 687,100 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-08-25 01:08:01
合計ジャッジ時間 5,468 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

fun readStrWithoutWS () =
    let
        val sOption = TextIO.inputLine TextIO.stdIn
    in
        case sOption of
            NONE => ""
          | SOME s => 
            String.implode
                (List.filter
                     (fn c => Char.isAlphaNum c)
                     (String.explode s))
    end

val () =
    let
        val s = readStrWithoutWS ()
        val ans =
            if String.size s = 0 then 1
            else
                (
                  List.foldl
                      (fn (ch, acc) => if ch = #"L" then acc * 2 else acc * 2 + 1)
                      1
                      (String.explode s)
                )
    in
        print (Int.toString ans ^ "\n")
    end
0