結果

問題 No.893 お客様を誘導せよ
ユーザー kpinkcat
提出日時 2023-08-23 11:08:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 742 bytes
コンパイル時間 899 ms
コンパイル使用メモリ 105,196 KB
最終ジャッジ日時 2025-02-16 12:30:58
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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