結果

問題 No.893 お客様を誘導せよ
ユーザー ajiruajiruajiruajiru
提出日時 2019-12-05 21:49:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 618 bytes
コンパイル時間 705 ms
コンパイル使用メモリ 80,884 KB
実行使用メモリ 4,676 KB
最終ジャッジ日時 2023-08-24 16:28:50
合計ジャッジ時間 2,323 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 5 ms
4,380 KB
testcase_03 AC 14 ms
4,380 KB
testcase_04 AC 14 ms
4,380 KB
testcase_05 AC 13 ms
4,380 KB
testcase_06 AC 9 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 28 ms
4,676 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <tuple>
using namespace std;
int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int N, P, A;
	cin >> N;
	//<順番、レジ番号、お客様番号>
	vector<tuple<int, int, int> > customer;
	for (int i = 0; i < N; ++i) {
		cin >> P;
		for (int j = 0; j < P; ++j) {
			cin >> A;
			customer.push_back({ j,i,A });
		}
	}
	sort(customer.begin(), customer.end());
	for (int i = 0; i < customer.size(); ++i) {
		if (i == customer.size() - 1)
			cout << get<2>(customer[i]) << endl;
		else
			cout << get<2>(customer[i]) << " ";
	}
	return 0;
}
0