31872023-02-21 19:24:40balaaaazsZsonglőrködéscpp14Wrong answer 0/100449ms45320 KiB
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>


using namespace std;

bool eszerint(pair<int, int> p1, pair<int, int> p2)
{
    if(p1.first==p2.first)
        return p1.second<p2.second;
    else
        return p1.first<p2.first;
}
int main()
{
    int n;
    cin>>n;
    vector<pair<int, int>> v(n);
    for(int i=0;i<n;i++)
        cin>>v.at(i).first>>v.at(i).second;

    map<int, int> k;
    int tot = n;
    for (int i = 0; i < n; i++)
     {
        if (k[v[i].first] > 0)
            {
            k[v[i].first]--;
            tot--;
        }
        k[v[i].second]++;
    }
    cout << tot << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1808 KiB
2Accepted3ms2056 KiB
subtask20/20
3Accepted4ms2804 KiB
4Accepted104ms14556 KiB
5Wrong answer289ms33100 KiB
6Accepted361ms39452 KiB
7Accepted409ms43564 KiB
8Accepted407ms43776 KiB
9Accepted407ms43736 KiB
10Accepted439ms44008 KiB
11Wrong answer449ms43992 KiB
subtask30/35
12Accepted3ms3688 KiB
13Wrong answer3ms3804 KiB
14Wrong answer3ms3820 KiB
15Wrong answer3ms3996 KiB
16Wrong answer3ms4224 KiB
17Wrong answer3ms4368 KiB
18Wrong answer3ms4504 KiB
19Wrong answer3ms4380 KiB
20Wrong answer3ms4380 KiB
subtask40/45
21Accepted4ms4916 KiB
22Wrong answer57ms5240 KiB
23Wrong answer305ms35148 KiB
24Wrong answer167ms7536 KiB
25Wrong answer446ms45320 KiB
26Wrong answer188ms7824 KiB
27Wrong answer441ms45160 KiB
28Wrong answer186ms7728 KiB
29Wrong answer439ms45288 KiB