結果

問題 No.279 木の数え上げ
ユーザー hum_ophum_op
提出日時 2016-03-31 13:40:24
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 467 bytes
コンパイル時間 11,822 ms
コンパイル使用メモリ 198,524 KB
実行使用メモリ 42,112 KB
最終ジャッジ日時 2024-04-10 06:44:59
合計ジャッジ時間 16,484 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (261 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.fs(16,19): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '' '' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System
open System.Text

let min (x:int) (y:int) =
    
    if x < y then
        x
    else 
        y
  
[<EntryPoint>]
let main args =    
    let S:string = Console.ReadLine()
    let mutable t, r, e = 0, 0, 0
    for x = 0 to S.Length-1 do
            match S.[x] with
            | 't' -> t <- t + 1
            | 'r' -> r <- r + 1
            | 'e' -> e <- e + 1
    done
    e <- e / 2
    let res = min t r
    
    printfn "%d" res
        
    0
    
0