結果

問題 No.893 お客様を誘導せよ
ユーザー kpinkcatkpinkcat
提出日時 2023-08-23 11:08:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 742 bytes
コンパイル時間 1,002 ms
コンパイル使用メモリ 106,284 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-23 11:08:09
合計ジャッジ時間 2,622 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 6 ms
4,376 KB
testcase_03 AC 19 ms
4,380 KB
testcase_04 AC 19 ms
4,380 KB
testcase_05 AC 18 ms
4,376 KB
testcase_06 AC 12 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 37 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;


int main()
{
    int n, max1=0;
    cin >> n;
    vector<vector<int>> v(n);
    for (int i = 0; i < n; i++){
        int t;
        cin >> t;
        max1 = max(max1, t);
        for (int j = 0; j < t; j++){
            int c;
            cin >> c;
            v[i].push_back(c);
        } 
    }
    for (int i = 0; i < max1; i++){
        for (int j = 0; j < n; j++){
            if (!v[j].empty()){
                if (i != 0 || j != 0) cout << " ";
                cout << v[j][0];
                v[j].erase(v[j].begin());
            }
        } 
    }
    cout << endl;
}
0