4261 | 2023-03-20 19:04:05 | balaaaazs | Zsonglőrködés | cpp14 | Wrong answer 0/100 | 200ms | 7712 KiB |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Interv{
int eleje;
int vege;
};
int main()
{
int n;
cin>>n;
vector<Interv> vec(n);
for(int i=0;i<n;i++)
cin>>vec.at(i).eleje>>vec.at(i).vege;
sort(vec.begin(),vec.end(), [](const Interv& a, const Interv& b)
{
if(a.eleje<b.eleje) return true;
if(a.eleje>b.eleje) return false;
return a.vege<b.vege;
});
int sz=0;
for(int i=1;i<n;i++)
if(vec.at(i-1).vege>vec.at(i).eleje)
sz++;
cout<<sz;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1812 KiB | ||||
2 | Accepted | 3ms | 2052 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Wrong answer | 4ms | 2280 KiB | ||||
4 | Wrong answer | 61ms | 3308 KiB | ||||
5 | Wrong answer | 150ms | 4972 KiB | ||||
6 | Wrong answer | 180ms | 5340 KiB | ||||
7 | Wrong answer | 200ms | 5824 KiB | ||||
8 | Wrong answer | 199ms | 5892 KiB | ||||
9 | Wrong answer | 200ms | 5980 KiB | ||||
10 | Wrong answer | 200ms | 6444 KiB | ||||
11 | Wrong answer | 199ms | 6444 KiB | ||||
subtask3 | 0/35 | ||||||
12 | Wrong answer | 2ms | 3428 KiB | ||||
13 | Wrong answer | 3ms | 3444 KiB | ||||
14 | Wrong answer | 3ms | 3532 KiB | ||||
15 | Wrong answer | 3ms | 3652 KiB | ||||
16 | Wrong answer | 3ms | 3896 KiB | ||||
17 | Wrong answer | 3ms | 3972 KiB | ||||
18 | Wrong answer | 3ms | 4100 KiB | ||||
19 | Wrong answer | 3ms | 4160 KiB | ||||
20 | Wrong answer | 3ms | 4156 KiB | ||||
subtask4 | 0/45 | ||||||
21 | Wrong answer | 4ms | 4056 KiB | ||||
22 | Wrong answer | 59ms | 4844 KiB | ||||
23 | Wrong answer | 149ms | 6528 KiB | ||||
24 | Wrong answer | 172ms | 7052 KiB | ||||
25 | Wrong answer | 199ms | 7456 KiB | ||||
26 | Wrong answer | 194ms | 7436 KiB | ||||
27 | Wrong answer | 199ms | 7300 KiB | ||||
28 | Wrong answer | 190ms | 7516 KiB | ||||
29 | Wrong answer | 199ms | 7712 KiB |