結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-16 05:00:34 |
| 言語 | Nim (2.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 771 bytes |
| コンパイル時間 | 905 ms |
| コンパイル使用メモリ | 74,088 KB |
| 最終ジャッジ日時 | 2024-11-14 20:43:21 |
| 合計ジャッジ時間 | 1,263 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
/home/judge/data/code/Main.nim(2, 28) Error: cannot open file: queues
ソースコード
import sequtils,strutils,algorithm,math,sugar,macros,strformat
import sets,tables,intsets,queues,heapqueue,bitops
template get*():string = stdin.readLine().strip()
macro unpack*(arr: auto,cnt: static[int]): auto =
let t = genSym(); result = quote do:(let `t` = `arr`;())
for i in 0..<cnt: result[1].add(quote do:`t`[`i`])
template times*(n:int,body) = (for _ in 0..<n: body)
template `max=`*(x,y) = x = max(x,y)
template `min=`*(x,y) = x = min(x,y)
let (h,n) = get().split().map(parseInt).unpack(2)
let H = @[h].concat(newSeqWith(n-1,get().parseInt())).sorted(cmp,Descending)
for i,hi in H:
if hi != h: continue
let th = i + 1
case th mod 10:
of 1: echo fmt"{th}st"
of 2: echo fmt"{th}nd"
of 3: echo fmt"{th}rd"
else: echo fmt"{th}th"
quit(0)