42452023-03-18 09:22:41balaaaazsZsonglőrködéscpp14Wrong answer 0/100232ms15948 KiB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

struct ido{
    int kezdo;
    int fejezo;
};

int main()
{
    int n;
    cin>>n;
    vector<ido> vec(n);
    for(int i=0;i<n;i++)
        cin>>vec.at(i).kezdo>>vec.at(i).fejezo;
    vector<pair<int, int>> v;
    for(int i=0;i<n;i++){
        v.push_back({vec.at(i).kezdo, 1});
        v.push_back({vec.at(i).fejezo, -1});
    }
    sort(v.begin(),v.end(),[](const pair<int, int>&a, const pair<int, int>&b)
         {
            if(a.first<b.first) return true;
            if(a.first>b.first) return false;
            return a.second<b.second;
         }
         );
    int kicsi=0,legk=0;
    for(auto x:v)
    {
        kicsi+=x.second;
        if(legk<kicsi)
            legk=kicsi;
    }
    cout<<legk;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1692 KiB
2Accepted3ms1848 KiB
subtask20/20
3Wrong answer4ms2296 KiB
4Wrong answer75ms5028 KiB
5Wrong answer177ms13044 KiB
6Wrong answer209ms13764 KiB
7Wrong answer232ms14020 KiB
8Wrong answer232ms14276 KiB
9Wrong answer231ms14476 KiB
10Wrong answer231ms14896 KiB
11Wrong answer232ms14988 KiB
subtask30/35
12Wrong answer2ms3428 KiB
13Accepted3ms3588 KiB
14Wrong answer3ms3556 KiB
15Accepted3ms3564 KiB
16Accepted3ms3456 KiB
17Wrong answer3ms3460 KiB
18Accepted3ms3544 KiB
19Wrong answer3ms3456 KiB
20Wrong answer3ms3800 KiB
subtask40/45
21Wrong answer4ms3968 KiB
22Accepted65ms6940 KiB
23Wrong answer175ms14556 KiB
24Accepted192ms15048 KiB
25Wrong answer231ms15324 KiB
26Accepted214ms15464 KiB
27Wrong answer231ms15576 KiB
28Accepted210ms15948 KiB
29Wrong answer232ms15688 KiB