結果

問題 No.893 お客様を誘導せよ
ユーザー kafuka97kafuka97
提出日時 2019-09-27 21:31:08
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 742 bytes
コンパイル時間 1,802 ms
コンパイル使用メモリ 177,868 KB
実行使用メモリ 4,496 KB
最終ジャッジ日時 2023-10-25 01:52:26
合計ジャッジ時間 2,596 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 5 ms
4,348 KB
testcase_03 AC 13 ms
4,444 KB
testcase_04 AC 14 ms
4,436 KB
testcase_05 AC 12 ms
4,364 KB
testcase_06 AC 9 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 22 ms
4,496 KB
testcase_09 AC 2 ms
4,496 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 3 ms
4,492 KB
testcase_12 AC 3 ms
4,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0