結果

問題 No.759 悪くない忘年会にしような!
ユーザー PachicobuePachicobue
提出日時 2018-12-07 01:49:55
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,142 bytes
コンパイル時間 2,831 ms
コンパイル使用メモリ 232,904 KB
実行使用メモリ 22,356 KB
最終ジャッジ日時 2023-10-12 03:25:28
合計ジャッジ時間 10,779 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,352 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 1 ms
4,352 KB
testcase_16 AC 1 ms
4,352 KB
testcase_17 AC 2 ms
4,352 KB
testcase_18 AC 2 ms
4,352 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 1 ms
4,352 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 1 ms
4,352 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 1 ms
4,348 KB
testcase_27 AC 1 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 1 ms
4,348 KB
testcase_32 AC 2 ms
4,352 KB
testcase_33 AC 15 ms
4,488 KB
testcase_34 AC 3 ms
4,348 KB
testcase_35 AC 8 ms
4,348 KB
testcase_36 WA -
testcase_37 AC 4 ms
4,348 KB
testcase_38 WA -
testcase_39 AC 4 ms
4,352 KB
testcase_40 WA -
testcase_41 AC 14 ms
4,492 KB
testcase_42 AC 16 ms
4,608 KB
testcase_43 AC 18 ms
4,628 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 AC 18 ms
4,608 KB
testcase_51 WA -
testcase_52 AC 18 ms
4,636 KB
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 465 ms
22,072 KB
testcase_64 WA -
testcase_65 AC 190 ms
16,804 KB
testcase_66 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
int main()
{
    int N;
    std::cin >> N;
    using P = std::pair<int, int>;
    using PP = std::pair<int, P>;
    std::vector<PP> s;
    std::map<PP, 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<P, int> mp2;
    for (const auto& pp : s) {
        if (mp2.find(pp.second) == mp2.end()) { mp2[pp.second] = mp[pp]; }
    }
    std::set<int> ans;
    std::set<P> ps;
    for (const auto& q : s) {
        const P p = q.second;
        auto it = ps.lower_bound(p);
        if (it != ps.end() and it->second >= p.second) { continue; }
        ans.insert(mp2[p]);
        std::vector<P> er;
        it = ps.upper_bound(p);
        if (it != ps.begin()) {
            it--;
            for (; it->second <= p.second; it--) {
                er.push_back(*it);
                if (it == ps.begin()) { break; }
            }
            for (const auto& e : er) { ps.erase(e); }
        }
        ps.insert(p);
    }
    for (const int i : ans) { std::cout << i << std::endl; }
    return 0;
}
0