結果

問題 No.759 悪くない忘年会にしような!
ユーザー PachicobuePachicobue
提出日時 2018-12-07 01:33:14
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,259 bytes
コンパイル時間 2,699 ms
コンパイル使用メモリ 232,024 KB
実行使用メモリ 26,276 KB
最終ジャッジ日時 2023-10-12 03:25:10
合計ジャッジ時間 11,245 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 1 ms
4,352 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,352 KB
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 1 ms
4,352 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 2 ms
4,352 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,352 KB
testcase_23 AC 2 ms
4,352 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 1 ms
4,348 KB
testcase_27 AC 2 ms
4,352 KB
testcase_28 AC 2 ms
4,352 KB
testcase_29 AC 2 ms
4,348 KB
testcase_30 AC 2 ms
4,352 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 1 ms
4,348 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 AC 431 ms
26,276 KB
testcase_64 AC 434 ms
26,124 KB
testcase_65 AC 223 ms
23,024 KB
testcase_66 AC 413 ms
25,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
struct P
{
    int x, y, z;
    bool operator<(const P& p) const { return x != p.x ? x < p.x : y != p.y ? y < p.y : z < p.z; }
};
struct P2
{
    int y, z;
    bool operator<(const P2& p) const { return y != p.y ? y < p.y : z < p.z; }
};
int main()
{
    int N;
    std::cin >> N;
    std::vector<P> s;
    std::map<P, int> mp;
    for (int i = 0, x, y, z; i < N; i++) { std::cin >> x >> y >> z, s.push_back({x, y, z}), mp[s.back()] = i + 1; }
    std::sort(s.begin(), s.end());
    std::map<P2, int> mp2;
    for (int i = N - 1; i >= 0; i--) {
        const P2 p = {s[i].y, s[i].z};
        if (mp2.find(p) == mp2.end()) { mp2[p] = mp[s[i]]; }
    }
    std::set<P2> ps;
    for (const auto& q : s) {
        const P2 p = {q.y, q.z};
        std::vector<P2> er;
        auto it = ps.upper_bound(p);
        if (it != ps.begin()) {
            it--;
            for (; it->z <= q.z; it--) {
                er.push_back(*it);
                if (it == ps.begin()) { break; }
            }
            for (const auto& e : er) { ps.erase(e); }
        }
        ps.insert(p);
    }
    std::set<int> ans;
    for (const auto& p : ps) { ans.insert(mp2[p]); }
    for (const int i : ans) { std::cout << i << std::endl; }
    return 0;
}
0