167682025-05-12 13:17:19BencuFőnökszámcpp17Wrong answer 0/100497ms31852 KiB
#include <bits/stdc++.h>

using namespace std;
ifstream f("be.in");
long long n,mb,ma,l;

struct Bencu {
    long long a;
    long long b;
}L[200010];

void torol (int i) {
    for (int j=i; j<l; j++) {
        L[j].a=L[j+1].a;
        L[j].b=L[j+1].b;
    }
    l--;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    int a,b;
    cin>>a>>b;
    ma=a;
    mb=b;
    L[1].a=a;
    L[1].b=b;
    l++;
    cout<<l<<endl;
    for (int t=1; t<=l; t++) cout<<"("<<L[t].a<<" "<<L[t].b<<")";
        cout<<endl;
    for (int z=2; z<=n; z++) {
        cin>>a>>b;
        //cout<<z<<":";
        if (a>=ma || b>=mb) {
            if (a>ma) ma=a;
            if (b>mb) mb=b;
            for (int i=1; i<=l; i++) {
                if (L[i].a<ma && L[i].b<b) {
                    torol(i);
                    i--;
                }
            }
            l++;
            L[l].a=a;
            L[l].b=b;
        }
        cout<<l<<"+"<<"("<<a<<" "<<b<<")"<<endl;
        for (int t=1; t<=l; t++) cout<<"("<<L[t].a<<" "<<L[t].b<<")";
        cout<<endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms316 KiB
2Wrong answer351ms5952 KiB
subtask20/5
3Wrong answer1ms316 KiB
4Wrong answer1ms316 KiB
5Wrong answer4ms500 KiB
6Wrong answer32ms564 KiB
subtask30/10
7Wrong answer1ms500 KiB
8Wrong answer2ms316 KiB
9Wrong answer4ms564 KiB
10Wrong answer2ms316 KiB
11Wrong answer3ms316 KiB
12Wrong answer4ms316 KiB
13Wrong answer14ms480 KiB
14Wrong answer18ms464 KiB
subtask40/10
15Wrong answer1ms512 KiB
16Wrong answer2ms316 KiB
17Wrong answer14ms820 KiB
18Wrong answer10ms564 KiB
19Wrong answer59ms1808 KiB
20Wrong answer108ms3380 KiB
21Wrong answer105ms3544 KiB
22Time limit exceeded497ms24856 KiB
subtask50/25
23Wrong answer3ms508 KiB
24Wrong answer4ms512 KiB
25Wrong answer12ms316 KiB
26Wrong answer18ms588 KiB
27Wrong answer203ms2780 KiB
28Wrong answer319ms5060 KiB
29Wrong answer400ms4664 KiB
30Wrong answer381ms4836 KiB
subtask60/50
31Wrong answer1ms512 KiB
32Wrong answer370ms5936 KiB
33Wrong answer1ms316 KiB
34Wrong answer1ms316 KiB
35Wrong answer4ms500 KiB
36Wrong answer32ms564 KiB
37Wrong answer1ms500 KiB
38Wrong answer2ms316 KiB
39Wrong answer4ms564 KiB
40Wrong answer2ms316 KiB
41Wrong answer3ms316 KiB
42Wrong answer4ms316 KiB
43Wrong answer14ms480 KiB
44Wrong answer18ms464 KiB
45Wrong answer1ms512 KiB
46Wrong answer2ms316 KiB
47Wrong answer14ms820 KiB
48Wrong answer10ms564 KiB
49Wrong answer59ms1808 KiB
50Wrong answer108ms3380 KiB
51Wrong answer105ms3544 KiB
52Time limit exceeded497ms24856 KiB
53Wrong answer3ms508 KiB
54Wrong answer4ms512 KiB
55Wrong answer12ms316 KiB
56Wrong answer18ms588 KiB
57Wrong answer203ms2780 KiB
58Wrong answer319ms5060 KiB
59Wrong answer400ms4664 KiB
60Wrong answer381ms4836 KiB
61Wrong answer25ms820 KiB
62Wrong answer28ms820 KiB
63Wrong answer32ms1028 KiB
64Time limit exceeded481ms24116 KiB
65Wrong answer25ms780 KiB
66Wrong answer24ms536 KiB
67Wrong answer24ms564 KiB
68Wrong answer27ms696 KiB
69Time limit exceeded490ms19432 KiB
70Time limit exceeded493ms31852 KiB