結果
| 問題 |
No.893 お客様を誘導せよ
|
| コンテスト | |
| ユーザー |
hatsuka_iwa
|
| 提出日時 | 2021-01-27 05:14:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 706 bytes |
| コンパイル時間 | 1,746 ms |
| コンパイル使用メモリ | 174,848 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-24 03:02:17 |
| 合計ジャッジ時間 | 2,869 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<queue<int>> A(N);
bool check = true;
int max_queue = 0, max_size = INT_MIN;
for (int i = 0; i < N; i++) {
int P;
cin >> P;
for (int j = 0; j < P; j++) {
int a;
cin >> a;
A.at(i).push(a);
}
if ((int)A.at(i).size() >= max_size) {
max_queue = i;
max_size = A.at(i).size();
}
}
while (check) {
check = false;
for (int i = 0; i < N; i++) {
if (!A.at(i).empty()) {
check = true;
cout << A.at(i).front();
A.at(i).pop();
if(!A.at(max_queue).empty())
cout << ' ';
}
}
}
cout << endl;
}
hatsuka_iwa