結果
問題 | No.893 お客様を誘導せよ |
ユーザー |
|
提出日時 | 2019-09-27 22:46:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 657 bytes |
コンパイル時間 | 1,779 ms |
コンパイル使用メモリ | 175,192 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 00:03:13 |
合計ジャッジ時間 | 2,528 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int n;cin >> n;int sum = 0;vector<deque<int>> a(n);for(int i = 0; i < n; ++i){int p;cin >> p;sum += p;for(int j = 0; j < p; ++j){int x; scanf("%d", &x);a[i].emplace_back(x);}}int i = 0;vector<int> res;while(sum){if(!a[i].empty()){res.emplace_back(a[i].front()); a[i].pop_front();--sum;}++i;if(i >= n) i = 0;}for(int x : res){cout << x << " ";}cout << endl;return 0;}