結果

問題 No.759 悪くない忘年会にしような!
ユーザー pekempeypekempey
提出日時 2018-12-07 04:12:07
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 677 ms / 2,000 ms
コード長 867 bytes
コンパイル時間 698 ms
コンパイル使用メモリ 71,272 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2023-10-12 03:31:09
合計ジャッジ時間 15,972 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,352 KB
testcase_17 AC 2 ms
4,356 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 2 ms
4,352 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,352 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 1 ms
4,352 KB
testcase_28 AC 1 ms
4,352 KB
testcase_29 AC 2 ms
4,352 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 1 ms
4,352 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 47 ms
4,352 KB
testcase_34 AC 9 ms
4,348 KB
testcase_35 AC 26 ms
4,348 KB
testcase_36 AC 46 ms
4,348 KB
testcase_37 AC 11 ms
4,348 KB
testcase_38 AC 52 ms
4,352 KB
testcase_39 AC 12 ms
4,348 KB
testcase_40 AC 37 ms
4,352 KB
testcase_41 AC 43 ms
4,352 KB
testcase_42 AC 53 ms
4,352 KB
testcase_43 AC 57 ms
4,352 KB
testcase_44 AC 553 ms
5,188 KB
testcase_45 AC 556 ms
5,060 KB
testcase_46 AC 557 ms
5,052 KB
testcase_47 AC 555 ms
5,112 KB
testcase_48 AC 553 ms
5,248 KB
testcase_49 AC 57 ms
4,348 KB
testcase_50 AC 57 ms
4,348 KB
testcase_51 AC 57 ms
4,352 KB
testcase_52 AC 57 ms
4,348 KB
testcase_53 AC 563 ms
5,244 KB
testcase_54 AC 555 ms
5,100 KB
testcase_55 AC 551 ms
5,240 KB
testcase_56 AC 552 ms
5,244 KB
testcase_57 AC 553 ms
5,120 KB
testcase_58 AC 553 ms
5,096 KB
testcase_59 AC 553 ms
5,240 KB
testcase_60 AC 555 ms
5,044 KB
testcase_61 AC 553 ms
5,096 KB
testcase_62 AC 554 ms
5,184 KB
testcase_63 AC 677 ms
5,172 KB
testcase_64 AC 677 ms
5,060 KB
testcase_65 AC 547 ms
5,060 KB
testcase_66 AC 661 ms
5,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    }
}

0