結果
問題 |
No.564 背の順
|
ユーザー |
|
提出日時 | 2017-10-27 18:39:24 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 557 bytes |
コンパイル時間 | 16,080 ms |
コンパイル使用メモリ | 187,640 KB |
実行使用メモリ | 31,104 KB |
最終ジャッジ日時 | 2024-11-21 21:21:01 |
合計ジャッジ時間 | 15,677 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (305 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/
ソースコード
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"