結果
問題 | No.893 お客様を誘導せよ |
ユーザー |
![]() |
提出日時 | 2019-09-27 21:31:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 22 ms / 2,000 ms |
コード長 | 742 bytes |
コンパイル時間 | 1,655 ms |
コンパイル使用メモリ | 177,032 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-24 20:50:33 |
合計ジャッジ時間 | 2,410 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef int64_t i64; typedef uint64_t ui64; const int inf=1073741823; const i64 llinf=4611686018427387903LL; int main(void){ int n; scanf("%i",&n); int *p=new int[n]{}; queue<int> *a=new queue<int>[n]{}; set<int> s; for(int i=0;i<n;i++){ s.insert(i); scanf("%i",&p[i]); int d; for(int j=0;j<p[i];j++){ scanf("%i",&d); a[i].push(d); } } while(!s.empty()){ for(int i=0;i<n;i++){ if(a[i].empty()){ s.erase(i); continue; } printf(" %i",a[i].front()); a[i].pop(); } } printf("\n"); return 0; }