4245 | 2023-03-18 09:22:41 | balaaaazs | Zsonglőrködés | cpp14 | Wrong answer 0/100 | 232ms | 15948 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1692 KiB | ||||
2 | Accepted | 3ms | 1848 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Wrong answer | 4ms | 2296 KiB | ||||
4 | Wrong answer | 75ms | 5028 KiB | ||||
5 | Wrong answer | 177ms | 13044 KiB | ||||
6 | Wrong answer | 209ms | 13764 KiB | ||||
7 | Wrong answer | 232ms | 14020 KiB | ||||
8 | Wrong answer | 232ms | 14276 KiB | ||||
9 | Wrong answer | 231ms | 14476 KiB | ||||
10 | Wrong answer | 231ms | 14896 KiB | ||||
11 | Wrong answer | 232ms | 14988 KiB | ||||
subtask3 | 0/35 | ||||||
12 | Wrong answer | 2ms | 3428 KiB | ||||
13 | Accepted | 3ms | 3588 KiB | ||||
14 | Wrong answer | 3ms | 3556 KiB | ||||
15 | Accepted | 3ms | 3564 KiB | ||||
16 | Accepted | 3ms | 3456 KiB | ||||
17 | Wrong answer | 3ms | 3460 KiB | ||||
18 | Accepted | 3ms | 3544 KiB | ||||
19 | Wrong answer | 3ms | 3456 KiB | ||||
20 | Wrong answer | 3ms | 3800 KiB | ||||
subtask4 | 0/45 | ||||||
21 | Wrong answer | 4ms | 3968 KiB | ||||
22 | Accepted | 65ms | 6940 KiB | ||||
23 | Wrong answer | 175ms | 14556 KiB | ||||
24 | Accepted | 192ms | 15048 KiB | ||||
25 | Wrong answer | 231ms | 15324 KiB | ||||
26 | Accepted | 214ms | 15464 KiB | ||||
27 | Wrong answer | 231ms | 15576 KiB | ||||
28 | Accepted | 210ms | 15948 KiB | ||||
29 | Wrong answer | 232ms | 15688 KiB |