結果
問題 | No.893 お客様を誘導せよ |
ユーザー |
![]() |
提出日時 | 2020-07-20 00:04:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,145 ms / 2,000 ms |
コード長 | 463 bytes |
コンパイル時間 | 472 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 18,560 KB |
最終ジャッジ日時 | 2024-12-17 19:12:43 |
合計ジャッジ時間 | 8,052 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
from collections import deque n = int(input()) T = deque() b = deque() for i in range(n): m = input().split() a = deque() b.append(int(m[0])) if m[0] != 0: for j in range(1,int(m[0])+1): a.append(int(m[j])) else: a.append("0") T.append(a) #print(T) #print(sum(b)) k = 0 ans = [] while sum(b) != 0: if b[k%n] != 0: ans.append(T[k%n].popleft()) b[k%n] -= 1 k += 1 print(*ans)