結果

問題 No.893 お客様を誘導せよ
ユーザー yicodeyicode
提出日時 2023-05-16 12:40:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 893 bytes
コンパイル時間 1,755 ms
コンパイル使用メモリ 171,140 KB
実行使用メモリ 7,532 KB
最終ジャッジ日時 2023-08-21 04:57:19
合計ジャッジ時間 2,751 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
7,232 KB
testcase_01 AC 5 ms
7,232 KB
testcase_02 AC 9 ms
7,424 KB
testcase_03 AC 22 ms
7,528 KB
testcase_04 AC 22 ms
7,532 KB
testcase_05 AC 20 ms
7,420 KB
testcase_06 AC 15 ms
7,364 KB
testcase_07 AC 4 ms
7,296 KB
testcase_08 AC 40 ms
7,528 KB
testcase_09 AC 5 ms
7,296 KB
testcase_10 AC 5 ms
7,296 KB
testcase_11 AC 5 ms
7,316 KB
testcase_12 AC 6 ms
7,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
vector<vector<int>> X(1000, vector<int>(1000));
int main() {
    int N; cin >> N;
    int ma = 0;
    for(int i = 0; i < N; i++){
        int x; cin >> x;
        ma = max(ma,x);
        for(int j = 0; j <x; j++) {
            int z; cin >> z;
            X[i][j] = z;
        }
    }
    vector<int> A(ma);
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < ma; j++){
            A[j]++;
        }
    }
    vector<int> ans;
    for(int i = 0; i < ma; i++) {
        for(int j = 0; j < N; j++) {
            if(X[j][i] != 0) {
                ans.push_back(X[j][i]);
            }
        }
    }
    for(int i = 0; i < ans.size(); i++) {
        if(ans.size() - 1 == i) {
            cout << ans[i] << endl;
            return 0;
        }
        cout << ans[i] << " ";
    }
}
0