結果

問題 No.497 入れ子の箱
ユーザー finefine
提出日時 2017-03-24 23:03:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 571 bytes
コンパイル時間 1,667 ms
コンパイル使用メモリ 177,132 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-20 02:49:56
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,500 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef tuple<int, int, int> T;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<T> b(n);
	for (int i = 0; i < n; i++) {
		int d[3];
		for (int j = 0; j < 3; j++) cin >> d[j];
		sort(d, d + 3);
		b[i] = tie(d[0], d[1], d[2]);
	}
	sort(b.begin(), b.end());
	int ans = 0;
	int px = 0, py = 0, pz = 0;
	for (int i = 0; i < n; i++) {
		int x, y, z;
		tie(x, y, z) = b[i];
		if (px < x && py < y && pz < z) {
			ans++;
			px = x;
			py = y;
			pz = z;
		}
	}
	cout << ans << endl;
	return 0;
}
0