結果

問題 No.564 背の順
ユーザー toshiro_yanagi
提出日時 2018-06-05 18:38:30
言語 Nim
(2.2.0)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 3,644 ms
コンパイル使用メモリ 65,508 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 10:00:48
合計ジャッジ時間 4,013 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 8 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils, algorithm

let HN = readLine(stdin).split.map parseInt
var arr = newSeqWith(0, 0)

for i in 2 .. HN[1]:
  arr.add readLine(stdin).parseInt

arr.sort(cmp, Descending)
var i = 0
while i < arr.high:
  if arr[i] < HN[0]: break
  i += 1

echo i + 1, ["st", "nd", "rd", "th"][min(3, ($($i)[^1]).parseInt)]
0