結果

問題 No.2220 Range Insert & Point Mex
ユーザー roarisroaris
提出日時 2023-02-18 02:16:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 803 bytes
コンパイル時間 3,781 ms
コンパイル使用メモリ 215,780 KB
実行使用メモリ 30,924 KB
最終ジャッジ日時 2023-09-26 22:55:15
合計ジャッジ時間 15,761 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 389 ms
29,516 KB
testcase_21 AC 391 ms
30,924 KB
testcase_22 AC 392 ms
29,348 KB
testcase_23 AC 318 ms
24,800 KB
testcase_24 AC 202 ms
21,528 KB
testcase_25 AC 242 ms
16,652 KB
testcase_26 AC 274 ms
25,652 KB
testcase_27 AC 123 ms
19,620 KB
testcase_28 AC 149 ms
8,936 KB
testcase_29 AC 155 ms
8,932 KB
testcase_30 AC 155 ms
9,388 KB
testcase_31 AC 262 ms
25,084 KB
testcase_32 WA -
testcase_33 AC 220 ms
19,280 KB
testcase_34 WA -
testcase_35 AC 329 ms
27,024 KB
testcase_36 WA -
testcase_37 AC 330 ms
27,192 KB
testcase_38 AC 281 ms
24,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<n; i++)
#define pb push_back
typedef long long ll;

int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    
    int N; cin >> N;
    vector<vector<int>> event;
    rep(i, N) {
        int l, r, a; cin >> l >> r >> a;
        event.pb({l, 0, a});
        event.pb({r+1, 1, a});
    }
    int Q; cin >> Q;
    rep(i, Q) {
        int x; cin >> x;
        event.pb({x, 2, i});
    }
    sort(event.begin(), event.end());
    
    int ans[Q];
    set<int> s;
    rep(i, N+1) s.insert(i);
    
    rep(i, event.size()) {
        if (event[i][1]==0) s.erase(event[i][2]);
        else if (event[i][1]==1) s.insert(event[i][2]);
        else ans[event[i][2]] = *s.begin();
    }
    
    rep(i, Q) cout << ans[i] << endl;
}
0