結果
問題 | No.893 お客様を誘導せよ |
ユーザー |
![]() |
提出日時 | 2020-01-24 19:21:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 23 ms / 2,000 ms |
コード長 | 547 bytes |
コンパイル時間 | 1,618 ms |
コンパイル使用メモリ | 172,576 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 03:46:59 |
合計ジャッジ時間 | 2,743 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N; scanf("%d", &N); vector< queue<int> > A(N); int q = 0; for (int i = 0; i < N; ++i) { int P; scanf("%d", &P); q += P; for (int j = 0; j < P; ++j) { int a; scanf("%d", &a); A[i].push(a); } } while (q > 0) { for (int i = 0; i < N; ++i) { if (!A[i].empty()) { int next = A[i].front(); A[i].pop(); if (q == 1) cout << next << endl; else cout << next << " "; q--; } } } return 0; }