44432023-03-28 09:35:27PallanekPéterÁtvágás (75 pont)python3Wrong answer 44/75546ms16776 KiB
N=int(input())
foksz=[0]*N
for i in range(N-1):
    a,b=[int(i) for i in input().split()]
    foksz[a-1]+=1
    foksz[b-1]+=1
db=0; mxfok=0
for i in range(N):
    if foksz[i]>2:
        db+=1
    if mxfok<foksz[i]:
        mxfok=foksz[i]
print(db,N-mxfok-1)
SubtaskSumTestVerdictTimeMemory
base44/75
1Accepted0/017ms11096 KiB
2Accepted0/017ms11340 KiB
3Wrong answer0/041ms11764 KiB
4Partially correct2/417ms11720 KiB
5Partially correct2/417ms12120 KiB
6Accepted4/417ms12444 KiB
7Partially correct2/417ms12272 KiB
8Partially correct2/418ms12512 KiB
9Partially correct2/417ms12568 KiB
10Partially correct2/4485ms15392 KiB
11Partially correct2/4508ms15880 KiB
12Partially correct2/4493ms15984 KiB
13Partially correct2/4510ms15944 KiB
14Partially correct2/4512ms15904 KiB
15Partially correct2/4504ms16108 KiB
16Partially correct2/4509ms16004 KiB
17Partially correct2/4546ms16120 KiB
18Partially correct3/5531ms16516 KiB
19Partially correct3/6503ms16744 KiB
20Accepted6/6523ms16776 KiB
21Accepted2/217ms13828 KiB