30502023-02-08 23:37:28xxxLegtöbb unoka (80 pont)cpp14Wrong answer 60/809ms5100 KiB
#include <bits/stdc++.h>
#include <vector>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a[n+1];
    int x, y;
    for (int i = 0; i < m; i++) {
        cin >> x >> y;
        a[x].push_back(y);
    }

    int unokak, legtobbunoka = 0, unokai;
    for (int i = 1; i <= n; i++) {
        unokak = 0;
        for (int j = 0; j < a[i].size(); j++) {
          	unokak += a[a[i][j]].size();
       }
        if (unokak > legtobbunoka) {
            legtobbunoka = unokak;
            unokai = i;
        }
    }


    cout << unokai << " " << legtobbunoka << endl;

    return 0;

}
SubtaskSumTestVerdictTimeMemory
base60/80
1Accepted0/03ms1812 KiB
2Accepted0/06ms2776 KiB
3Wrong answer0/43ms2416 KiB
4Wrong answer0/43ms2484 KiB
5Accepted4/48ms3568 KiB
6Accepted4/49ms3652 KiB
7Wrong answer0/43ms3012 KiB
8Wrong answer0/43ms3116 KiB
9Accepted4/46ms3768 KiB
10Accepted4/48ms4276 KiB
11Accepted4/48ms4272 KiB
12Accepted4/46ms3888 KiB
13Accepted4/48ms4312 KiB
14Accepted4/48ms4304 KiB
15Accepted4/48ms4368 KiB
16Accepted4/48ms4580 KiB
17Accepted4/48ms4972 KiB
18Accepted4/48ms4740 KiB
19Wrong answer0/23ms4376 KiB
20Wrong answer0/23ms4388 KiB
21Accepted3/33ms4392 KiB
22Accepted3/34ms4580 KiB
23Accepted3/38ms5100 KiB
24Accepted3/38ms5092 KiB