結果

問題 No.79 過小評価ダメ・ゼッタイ
コンテスト
ユーザー Nobita Gomu
提出日時 2017-09-28 01:24:21
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 223 ms / 5,000 ms
コード長 631 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,338 ms
コンパイル使用メモリ 214,100 KB
実行使用メモリ 39,892 KB
最終ジャッジ日時 2026-03-13 00:14:41
合計ジャッジ時間 17,976 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (181 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

type Buf = { a:int[]; offset:int } with
    member private this.update (c:char) =
        let idx = (int c) - this.offset
        this.a.[idx] <- this.a.[idx] + 1

    member this.reader (s:string) =
        s
        |> Seq.filter (fun c -> c <> ' ')
        |> Seq.iter (fun c -> this.update c)

    member this.maxvalue =
        this.a
        |> Seq.mapi (fun i v -> (i+1, v))
        |> Seq.sortBy (fun (i, v) -> v)
        |> Seq.last
        |> fun (i, v) -> i

let buf = { a = [| for _ in 1..6 -> 0 |]; offset = int '1' }

stdin.ReadLine () |> ignore
stdin.ReadLine () |> buf.reader |> ignore

buf.maxvalue |> printfn "%d"
0