結果

問題 No.893 お客様を誘導せよ
ユーザー milanis48663220milanis48663220
提出日時 2019-09-27 21:34:46
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 61,084 KB
実行使用メモリ 7,636 KB
最終ジャッジ日時 2023-10-25 01:57:14
合計ジャッジ時間 1,175 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 8 ms
6,292 KB
testcase_03 AC 20 ms
7,176 KB
testcase_04 AC 20 ms
7,156 KB
testcase_05 AC 18 ms
6,744 KB
testcase_06 AC 13 ms
6,296 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 41 ms
7,636 KB
testcase_09 AC 4 ms
7,376 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
5,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int P[1000];
int A[1000][1000];
vector<int> ans;

int main(){
    int N;
    cin >> N;
    int cnt = 0;
    for(int i = 0; i < N; i++) {
        cin >> P[i];
        for(int j = 0; j < P[i]; j++){
            cin >> A[i][j];
            cnt++;
        }
    }
    for(int j = 0; j < 100; j++){
        for(int i = 0; i < N; i++){
            if(j < P[i]) {
                ans.push_back(A[i][j]);
            }
        }
    }
    for(int i = 0; i < cnt-1; i++){
        cout << ans[i] << ' ';
    }
    cout << ans[cnt-1] << endl; 
}
0