hello

Hello

  • Hi

    I’m comeing

    hello

    Hi\\NewLine

    #include<bits/stdc++.h>
    using namespace std;
    template<typename pqt>using pqg = priority_queue<pqt, vector<pqt>, greater<pqt>>;
    using pii = pair<int, int>;
    const int MAXM = 100012;
    pii a[MAXM], b[MAXM];
    int cnts[3][MAXM], n;
    inline void todo(pii* t, const int &m, int* res) {
    sort(t + 1, t + m + 1, [](const pii& a, const pii& b) { return a.first < b.first; });
    pqg<pii> onbrg; pqg<int> brg;
    for (int i = 1; i <= n; i++) brg.push(i);
    for (int i = 1; i <= m; i++) {
        while (!onbrg.empty() && t[i].first >= onbrg.top().first) {
            brg.push(onbrg.top().second);
            onbrg.pop();
        }
        if (brg.empty()) continue;
        res[brg.top()]++;
        onbrg.push({t[i].second, brg.top() });
        brg.pop();
    }
    for (int i = 1; i <= n; i++) res[i] += res[i - 1];
    }
    int main() {
    int m1, m2;
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n >> m1 >> m2;
    for (int i = 1; i <= m1; i++) cin >> a[i].first >> a[i].second;
    for (int i = 1; i <= m2; i++) cin >> b[i].first >> b[i].second;
    todo(a, m1, cnts[1]);
    todo(b, m2, cnts[2]);
    int rets = 0;
    for (int i = 0; i <= n; i++)
        rets = max(rets, cnts[1][i] + cnts[2][n - i]);
    cout << rets;
    }
    
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇