107802024-04-12 13:20:41BalimeFőnökszámcpp17Wrong answer 10/100418ms30324 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

ll n;    multiset<array<ll, 2>>fonok;



int main()
{
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
    cin>>n;
    fonok.insert({0,0});
    for(ll i=0; i<n; i++)
    {
        ll a,b;
        cin>>a>>b;
        auto it=fonok.upper_bound({a+1, b+1});
        if(it==fonok.end())
        {
            it = fonok.insert({a,b});
            it--;
        }
        else
        {
            cout<<fonok.size()-1<<endl;
            continue;
        }
        //cout<<(*it)[0]<<" rr "<<(*it)[1]<<endl;
        while(it!=fonok.begin())
        {
            if((*it)[0]>=a || (*it)[1]>=b)break;
            it=fonok.erase(it); it--;
        }
        auto help=fonok.begin();
        //while(help!=fonok.end()){cout<<(*help)[0]<<" "<<(*help)[1]<<endl;help++;}
        cout<<fonok.size()-1<<endl;
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1888 KiB
2Wrong answer116ms2088 KiB
subtask20/5
3Wrong answer3ms2196 KiB
4Wrong answer3ms2544 KiB
5Wrong answer4ms2496 KiB
6Accepted14ms2684 KiB
subtask30/10
7Accepted3ms2916 KiB
8Wrong answer3ms2760 KiB
9Accepted3ms2920 KiB
10Wrong answer3ms2892 KiB
11Wrong answer3ms2972 KiB
12Wrong answer4ms3108 KiB
13Wrong answer6ms3396 KiB
14Wrong answer8ms3332 KiB
subtask410/10
15Accepted3ms3428 KiB
16Accepted3ms3492 KiB
17Accepted4ms3344 KiB
18Accepted4ms3348 KiB
19Accepted28ms3560 KiB
20Accepted48ms3580 KiB
21Accepted54ms3784 KiB
22Accepted174ms16532 KiB
subtask50/25
23Wrong answer3ms4088 KiB
24Wrong answer4ms4208 KiB
25Wrong answer6ms4432 KiB
26Wrong answer8ms4516 KiB
27Wrong answer71ms4540 KiB
28Wrong answer90ms4768 KiB
29Wrong answer115ms4840 KiB
30Wrong answer116ms4844 KiB
subtask60/50
31Accepted3ms4984 KiB
32Wrong answer109ms4732 KiB
33Wrong answer3ms2196 KiB
34Wrong answer3ms2544 KiB
35Wrong answer4ms2496 KiB
36Accepted14ms2684 KiB
37Accepted3ms2916 KiB
38Wrong answer3ms2760 KiB
39Accepted3ms2920 KiB
40Wrong answer3ms2892 KiB
41Wrong answer3ms2972 KiB
42Wrong answer4ms3108 KiB
43Wrong answer6ms3396 KiB
44Wrong answer8ms3332 KiB
45Accepted3ms3428 KiB
46Accepted3ms3492 KiB
47Accepted4ms3344 KiB
48Accepted4ms3348 KiB
49Accepted28ms3560 KiB
50Accepted48ms3580 KiB
51Accepted54ms3784 KiB
52Accepted174ms16532 KiB
53Wrong answer3ms4088 KiB
54Wrong answer4ms4208 KiB
55Wrong answer6ms4432 KiB
56Wrong answer8ms4516 KiB
57Wrong answer71ms4540 KiB
58Wrong answer90ms4768 KiB
59Wrong answer115ms4840 KiB
60Wrong answer116ms4844 KiB
61Wrong answer8ms4696 KiB
62Wrong answer9ms5136 KiB
63Wrong answer13ms5004 KiB
64Accepted85ms11100 KiB
65Wrong answer14ms4908 KiB
66Wrong answer14ms4904 KiB
67Wrong answer8ms5004 KiB
68Wrong answer8ms5132 KiB
69Wrong answer236ms5140 KiB
70Time limit exceeded418ms30324 KiB