結果

問題 No.893 お客様を誘導せよ
ユーザー varrhovarrho
提出日時 2019-09-27 22:12:40
言語 Nim
(2.0.2)
結果
RE  
実行時間 -
コード長 501 bytes
コンパイル時間 5,983 ms
コンパイル使用メモリ 66,660 KB
実行使用メモリ 7,072 KB
最終ジャッジ日時 2023-10-24 21:22:12
合計ジャッジ時間 6,575 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 1 ms
4,372 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 1 ms
4,372 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 1 ms
4,372 KB
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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