結果

問題 No.571 3人兄弟(その2)
ユーザー taktak
提出日時 2018-08-06 19:53:57
言語 F#
(F# 4.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 604 bytes
コンパイル時間 6,709 ms
コンパイル使用メモリ 188,448 KB
実行使用メモリ 32,208 KB
最終ジャッジ日時 2023-10-19 22:17:57
合計ジャッジ時間 8,821 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
32,208 KB
testcase_01 AC 91 ms
32,208 KB
testcase_02 AC 94 ms
32,208 KB
testcase_03 AC 92 ms
32,208 KB
testcase_04 AC 91 ms
32,208 KB
testcase_05 AC 91 ms
32,208 KB
testcase_06 AC 91 ms
32,208 KB
testcase_07 AC 91 ms
32,208 KB
testcase_08 AC 91 ms
32,208 KB
testcase_09 AC 89 ms
32,208 KB
testcase_10 AC 89 ms
32,208 KB
testcase_11 AC 89 ms
32,208 KB
testcase_12 AC 90 ms
32,208 KB
testcase_13 AC 91 ms
32,208 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (238 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

let b = 
    let R () = 
        let t = stdin.ReadLine().Split() |> Array.map int
        (t.[0], t.[1])
    [|'A' .. 'C'|]
    |> Array.map (fun c -> 
        let (w, h) = R()
        (c, w, h))
    
b
|> Array.sortWith(fun (_, h, w) (_, h', w')->
    let isSameHeight = h = h'
    let compareByHeight =
        if   h > h' then -1
        elif h = h' then  0
        else 1
    let compareByWeight =
        if   w < w' then -1
        elif w = w' then  0
        else 1
    if isSameHeight then 
        compareByWeight
    else
        compareByHeight)
|> Array.iter(fun (c,_,_) -> printfn "%c" c)  
0