30492023-02-08 23:33:16xxxLegtöbb unoka (80 pont)cpp14Wrong answer 60/808ms5364 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/06ms2724 KiB
3Wrong answer0/43ms2220 KiB
4Wrong answer0/43ms2576 KiB
5Accepted4/48ms3508 KiB
6Accepted4/48ms3468 KiB
7Wrong answer0/43ms2944 KiB
8Wrong answer0/43ms3028 KiB
9Accepted4/46ms3488 KiB
10Accepted4/48ms4104 KiB
11Accepted4/48ms4312 KiB
12Accepted4/46ms3752 KiB
13Accepted4/48ms4240 KiB
14Accepted4/48ms4488 KiB
15Accepted4/48ms4472 KiB
16Accepted4/48ms4376 KiB
17Accepted4/48ms4660 KiB
18Accepted4/48ms4704 KiB
19Wrong answer0/23ms4448 KiB
20Wrong answer0/23ms4456 KiB
21Accepted3/33ms4356 KiB
22Accepted3/33ms4664 KiB
23Accepted3/38ms5312 KiB
24Accepted3/38ms5364 KiB