結果

問題 No.893 お客様を誘導せよ
ユーザー koi_kotyakoi_kotya
提出日時 2019-09-27 21:33:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 848 bytes
コンパイル時間 1,987 ms
コンパイル使用メモリ 177,592 KB
実行使用メモリ 4,620 KB
最終ジャッジ日時 2023-10-25 01:55:03
合計ジャッジ時間 2,782 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 7 ms
4,348 KB
testcase_03 AC 24 ms
4,348 KB
testcase_04 AC 23 ms
4,348 KB
testcase_05 AC 21 ms
4,348 KB
testcase_06 AC 14 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 48 ms
4,620 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;

#define p_ary(ary,a,b,i) do { cout << "["; for (int (i) = (a);(i) < (b);++(i)) cout << ary[(i)] << ((b)-1 == (i) ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

int main() {
    int n;
    cin >> n;
    vector<vector<int>> a(n);
    vector<P> b;
    for (int i = 0;i < n;++i) {
        int p;
        cin >> p;
        a[i].resize(p);
        for (int j = 0;j < p;++j) {
            cin >> a[i][j];
            b.push_back(P(j,i));
        }
    }
    sort(b.begin(),b.end());
    for (P& p : b) cout << a[p.second][p.first] << " \n"[p == b.back()];
    return 0;
}
0