結果
問題 |
No.893 お客様を誘導せよ
|
ユーザー |
|
提出日時 | 2019-09-27 21:25:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 612 bytes |
コンパイル時間 | 747 ms |
コンパイル使用メモリ | 76,488 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 20:41:46 |
合計ジャッジ時間 | 2,692 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 RE * 1 |
other | AC * 4 RE * 7 |
ソースコード
#include<iostream> #include<vector> #include<queue> using namespace std; int main(){ int n; cin >> n; queue<int> q[n]; for(int i = 0; i < n; i++){ int p; cin >> p; while(p-- > 0){ int x; cin >> x; q[i].push(x); } } queue<int> j; for(int i = 0; i < n; i++) j.push(i); vector<int> v; while(!j.empty()){ int x = j.front(); j.pop(); v.push_back(q[x].front()); q[x].pop(); if(!q[x].empty()) j.push(x); } for(int i = 0; i < v.size(); i++) cout << v[i] << " \n"[i+1==v.size()]; return 0; }