結果
問題 |
No.497 入れ子の箱
|
ユーザー |
|
提出日時 | 2017-03-24 23:03:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 571 bytes |
コンパイル時間 | 1,712 ms |
コンパイル使用メモリ | 179,800 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-05 23:10:24 |
合計ジャッジ時間 | 2,672 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 14 |
ソースコード
#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; }