107812024-04-12 13:30:08BalimeFőnökszámcpp17Wrong answer 15/100398ms30064 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.lower_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
1Accepted3ms1764 KiB
2Wrong answer119ms1996 KiB
subtask25/5
3Accepted3ms2220 KiB
4Accepted3ms2428 KiB
5Accepted4ms2640 KiB
6Accepted21ms2664 KiB
subtask30/10
7Accepted3ms2776 KiB
8Wrong answer3ms2872 KiB
9Accepted3ms2876 KiB
10Wrong answer3ms3000 KiB
11Wrong answer4ms3212 KiB
12Wrong answer4ms3300 KiB
13Wrong answer6ms3424 KiB
14Wrong answer8ms3648 KiB
subtask410/10
15Accepted3ms3860 KiB
16Accepted3ms4068 KiB
17Accepted4ms4400 KiB
18Accepted4ms4364 KiB
19Accepted24ms4460 KiB
20Accepted25ms4460 KiB
21Accepted48ms4448 KiB
22Accepted250ms16848 KiB
subtask50/25
23Wrong answer3ms4436 KiB
24Wrong answer4ms4440 KiB
25Wrong answer6ms4352 KiB
26Wrong answer8ms4580 KiB
27Wrong answer59ms4564 KiB
28Wrong answer93ms4568 KiB
29Wrong answer115ms4712 KiB
30Wrong answer225ms4812 KiB
subtask60/50
31Accepted2ms4772 KiB
32Wrong answer116ms4776 KiB
33Accepted3ms2220 KiB
34Accepted3ms2428 KiB
35Accepted4ms2640 KiB
36Accepted21ms2664 KiB
37Accepted3ms2776 KiB
38Wrong answer3ms2872 KiB
39Accepted3ms2876 KiB
40Wrong answer3ms3000 KiB
41Wrong answer4ms3212 KiB
42Wrong answer4ms3300 KiB
43Wrong answer6ms3424 KiB
44Wrong answer8ms3648 KiB
45Accepted3ms3860 KiB
46Accepted3ms4068 KiB
47Accepted4ms4400 KiB
48Accepted4ms4364 KiB
49Accepted24ms4460 KiB
50Accepted25ms4460 KiB
51Accepted48ms4448 KiB
52Accepted250ms16848 KiB
53Wrong answer3ms4436 KiB
54Wrong answer4ms4440 KiB
55Wrong answer6ms4352 KiB
56Wrong answer8ms4580 KiB
57Wrong answer59ms4564 KiB
58Wrong answer93ms4568 KiB
59Wrong answer115ms4712 KiB
60Wrong answer225ms4812 KiB
61Wrong answer8ms4776 KiB
62Wrong answer14ms4876 KiB
63Wrong answer8ms4776 KiB
64Accepted81ms10972 KiB
65Wrong answer13ms4776 KiB
66Wrong answer8ms4780 KiB
67Wrong answer8ms5060 KiB
68Wrong answer16ms5036 KiB
69Wrong answer259ms5044 KiB
70Accepted398ms30064 KiB