結果

問題 No.564 背の順
ユーザー toshiro_yanagi
提出日時 2018-06-05 11:48:05
言語 Nim
(2.2.0)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 3,309 ms
コンパイル使用メモリ 66,596 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 09:53:35
合計ジャッジ時間 3,987 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 6 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils, algorithm

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

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

arr.sort(cmp, Descending)
var i = 0
while not(i > arr.high or HN[0] > arr[i]): i += 1

echo i + 1, ["st", "nd", "th"][[i, 2][int(i > 2)]]
0