結果

問題 No.893 お客様を誘導せよ
コンテスト
ユーザー varrho
提出日時 2019-09-27 22:12:40
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 501 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,823 ms
コンパイル使用メモリ 71,008 KB
実行使用メモリ 8,576 KB
最終ジャッジ日時 2026-04-11 19:51:39
合計ジャッジ時間 4,727 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import algorithm, sequtils, strutils
var
  n: int = stdin.readline.parseInt
  a: seq[seq[int]] = mapIt(0..<n, stdin.readline.split.map(parseInt))
  ans: seq[int]
for i in 0..<n:
  a[i].delete(0)
for i in 0..<n:
  if a[i].len == 0:
    a.delete(i)
    n.dec
while a.len > 0:
  var tmp: seq[int]
  for i in 0..<n:
    tmp.add(a[i][0])
    a[i].delete(0)
  for i in 0..<n:
    if a[i].len == 0:
      a.delete(i)
      n.dec
  tmp.sort()
  ans.add(tmp)
for i in ans:
  stdout.write(i)
  stdout.write(" ")
0