42612023-03-20 19:04:05balaaaazsZsonglőrködéscpp14Wrong answer 0/100200ms7712 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1812 KiB
2Accepted3ms2052 KiB
subtask20/20
3Wrong answer4ms2280 KiB
4Wrong answer61ms3308 KiB
5Wrong answer150ms4972 KiB
6Wrong answer180ms5340 KiB
7Wrong answer200ms5824 KiB
8Wrong answer199ms5892 KiB
9Wrong answer200ms5980 KiB
10Wrong answer200ms6444 KiB
11Wrong answer199ms6444 KiB
subtask30/35
12Wrong answer2ms3428 KiB
13Wrong answer3ms3444 KiB
14Wrong answer3ms3532 KiB
15Wrong answer3ms3652 KiB
16Wrong answer3ms3896 KiB
17Wrong answer3ms3972 KiB
18Wrong answer3ms4100 KiB
19Wrong answer3ms4160 KiB
20Wrong answer3ms4156 KiB
subtask40/45
21Wrong answer4ms4056 KiB
22Wrong answer59ms4844 KiB
23Wrong answer149ms6528 KiB
24Wrong answer172ms7052 KiB
25Wrong answer199ms7456 KiB
26Wrong answer194ms7436 KiB
27Wrong answer199ms7300 KiB
28Wrong answer190ms7516 KiB
29Wrong answer199ms7712 KiB