結果
問題 | No.893 お客様を誘導せよ |
ユーザー |
|
提出日時 | 2019-09-27 21:29:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 731 bytes |
コンパイル時間 | 1,738 ms |
コンパイル使用メモリ | 171,440 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 20:48:31 |
合計ジャッジ時間 | 2,234 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main() {cin.tie(0);ios::sync_with_stdio(false);int n;cin >> n;vector< vector<int> > a(n);int maxp = 0;for (int i = 0; i < n; i++) {int p;cin >> p;maxp = max(maxp, p);a[i].resize(p);for (int j = 0; j < p; j++) {cin >> a[i][j];}}vector<int> ans;for (int j = 0; j < maxp; j++) {for (int i = 0; i < n; i++) {if (a[i].size() <= j) continue;ans.push_back(a[i][j]);}}int sz = ans.size();for (int i = 0; i < sz; i++) {cout << ans[i] << " \n"[i + 1 == sz];}return 0;}