結果
| 問題 |
No.759 悪くない忘年会にしような!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-07 04:12:07 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 595 ms / 2,000 ms |
| コード長 | 867 bytes |
| コンパイル時間 | 638 ms |
| コンパイル使用メモリ | 69,264 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-14 03:12:57 |
| 合計ジャッジ時間 | 12,449 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 64 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
struct P {
int x, y, z, i;
P(int x_, int y_, int z_, int i_) : x(x_), y(y_), z(z_), i(i_) {}
};
bool operator<(P a, P b) {
if (a.x != b.x) return a.x < b.x;
if (a.y != b.y) return a.y < b.y;
return a.z < b.z;
}
int main() {
int n;
cin >> n;
vector<P> a;
for (int i = 0; i < n; i++) {
int x, y, z;
cin >> x >> y >> z;
a.emplace_back(x, y, z, i);
}
sort(a.begin(), a.end());
vector<int> mx(10002, -1);
vector<bool> ans(n, true);
for (int i = n - 1; i >= 0; i--) {
if (a[i].z <= mx[a[i].y]) ans[a[i].i] = false;
for (int j = 0; j <= a[i].y; j++) {
mx[j] = max(mx[j], a[i].z);
}
}
for (int i = 0; i < n; i++) {
if (ans[i]) cout << i + 1 << endl;
}
}