結果

問題 No.706 多眼生物の調査
ユーザー taktak
提出日時 2018-07-02 18:41:35
言語 F#
(F# 4.0)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 509 bytes
コンパイル時間 5,067 ms
コンパイル使用メモリ 155,444 KB
実行使用メモリ 30,252 KB
最終ジャッジ日時 2023-09-13 16:58:04
合計ジャッジ時間 6,644 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
24,768 KB
testcase_01 AC 113 ms
28,872 KB
testcase_02 AC 118 ms
26,964 KB
testcase_03 AC 120 ms
26,924 KB
testcase_04 AC 122 ms
27,140 KB
testcase_05 AC 121 ms
27,260 KB
testcase_06 AC 125 ms
30,252 KB
testcase_07 AC 116 ms
26,904 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let R() = stdin.ReadLine()
let N   = R() |> int
let S   = Array.init N (fun _ -> R())

let modeKey = 
    let lis = 
        S 
        |> Array.map (fun x -> x.Length-2)
        |> Array.groupBy (fun x -> x)                 
    let mode = 
        lis 
        |> Array.maxBy (fun (_,len) -> len)
        |> fun (_,len) -> len

    let ret =
        lis
        |> Array.filter (fun (_,len) -> len = mode)
        |> Array.max
        |> fun (k,_) -> k         
    ret        

modeKey |> printfn "%i"
    
0