結果

問題 No.564 背の順
ユーザー ichibanshiboriichibanshibori
提出日時 2017-10-27 18:39:24
言語 F#
(F# 4.0)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 557 bytes
コンパイル時間 13,290 ms
コンパイル使用メモリ 185,284 KB
実行使用メモリ 30,976 KB
最終ジャッジ日時 2024-05-01 16:11:03
合計ジャッジ時間 14,868 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
30,720 KB
testcase_01 AC 71 ms
30,592 KB
testcase_02 AC 71 ms
30,720 KB
testcase_03 AC 68 ms
30,720 KB
testcase_04 AC 68 ms
30,592 KB
testcase_05 AC 69 ms
30,720 KB
testcase_06 AC 69 ms
30,976 KB
testcase_07 AC 73 ms
30,720 KB
testcase_08 AC 70 ms
30,848 KB
testcase_09 AC 72 ms
30,848 KB
testcase_10 AC 67 ms
30,720 KB
testcase_11 AC 70 ms
30,848 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (567 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let () =
    let h, n = stdin.ReadLine()
               |> fun l -> l.Split()
               |> Array.map int
               |> fun arr -> (arr.[0], arr.[1])

    seq { for i in 2..n -> stdin.ReadLine() |> int }
    |> Seq.filter (fun hn -> hn > h)
    |> Seq.length
    |> (+) 1
    |> (function
        | r when r % 10 = 1 -> System.String.Format("{0}st", r)
        | r when r % 10 = 2 -> System.String.Format("{0}nd", r)
        | r when r % 10 = 3 -> System.String.Format("{0}rd", r)
        | r -> System.String.Format("{0}th", r))
    |> printfn "%s"
0