結果

問題 No.8042 本棚
コンテスト
ユーザー nadeshino
提出日時 2020-05-19 18:15:10
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 491 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,157 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-18 06:50:33
合計ジャッジ時間 4,336 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import algorithm, sequtils, strutils
 
let read* = iterator: string =
  while true: (for s in stdin.readLine.split: yield s)
 
template input*(T: static[typedesc]): untyped = 
  when T is int: read().parseInt
  elif T is float: read().parseFloat
  elif T is string: read()
  elif T is char: read()[0]

let N = input(int)
let books: seq[tuple[S, id: string]] =
  newSeqWith(N, (S: input(string), id: input(string)))
  .sortedByIt((it.S, it.id))
echo books.mapIt(it.S & " " & it.id).join("\n")
0