Submission #209535

#TimeUsernameProblemLanguageResultExecution timeMemory
209535model_codeIsland (NOI18_island)Cpython 2
100 / 100
928 ms14152 KiB
N, M = map(int, raw_input().split()) cnt = [0]*(N+M+1) for i in range(N+M-1): u, v = map(int, raw_input().split()) cnt[u] = cnt[u] + 1 cnt[v] = cnt[v] + 1 fac = [0]*(N+M+1) for i in range(1, N+M+1): fac[cnt[i]-1] += 1 for k in range(N+M, 1, -1): if fac[k] > 0: fac[k-1] += fac[k] print ("%d %d" % (k, fac[k]))
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...