31162023-02-16 14:50:18PallanekPéterLegtöbb unoka (80 pont)python3Runtime error 60/8050ms16280 KiB
n,m=[int(i) for i in input().split()]
csalad=[[] for i in range(n)]
for i in range(m):
    u,v=[int(i) for i in input().split()]
    csalad[u-1].append(v-1)
Ldb=0
for i in range(n):
    ossz=0
    for j in range(len(csalad[i])):
        ossz+=len(csalad[csalad[i][j]])
    if ossz>Ldb:
        Ldb=ossz; Lh=i+1
print(Lh,Ldb)
SubtaskSumTestVerdictTimeMemory
base60/80
1Accepted0/017ms11080 KiB
2Accepted0/037ms13496 KiB
3Runtime error0/417ms11404 KiB
4Runtime error0/417ms11888 KiB
5Accepted4/448ms14076 KiB
6Accepted4/448ms14232 KiB
7Runtime error0/417ms11968 KiB
8Runtime error0/417ms12164 KiB
9Accepted4/434ms13624 KiB
10Accepted4/448ms14736 KiB
11Accepted4/448ms14932 KiB
12Accepted4/432ms13992 KiB
13Accepted4/448ms15464 KiB
14Accepted4/448ms15656 KiB
15Accepted4/448ms15816 KiB
16Accepted4/448ms15700 KiB
17Accepted4/450ms16120 KiB
18Accepted4/448ms16088 KiB
19Runtime error0/224ms15036 KiB
20Runtime error0/224ms14664 KiB
21Accepted3/324ms15044 KiB
22Accepted3/326ms15100 KiB
23Accepted3/348ms16280 KiB
24Accepted3/348ms16276 KiB