結果

問題 No.893 お客様を誘導せよ
ユーザー ajiruajiru
提出日時 2019-12-05 21:49:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 618 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 81,656 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 00:37:55
合計ジャッジ時間 2,695 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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