# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
209535 |
2020-03-14T12:47:56 Z |
model_code |
Island (NOI18_island) |
Python 2 |
|
928 ms |
14152 KB |
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 time |
Memory |
Grader output |
1 |
Correct |
18 ms |
2936 KB |
Output is correct |
2 |
Correct |
14 ms |
2936 KB |
Output is correct |
3 |
Correct |
836 ms |
12920 KB |
Output is correct |
4 |
Correct |
928 ms |
13908 KB |
Output is correct |
5 |
Correct |
190 ms |
5056 KB |
Output is correct |
6 |
Correct |
922 ms |
14044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
2936 KB |
Output is correct |
2 |
Correct |
16 ms |
2936 KB |
Output is correct |
3 |
Correct |
18 ms |
2936 KB |
Output is correct |
4 |
Correct |
15 ms |
2936 KB |
Output is correct |
5 |
Correct |
21 ms |
2936 KB |
Output is correct |
6 |
Correct |
14 ms |
2936 KB |
Output is correct |
7 |
Correct |
15 ms |
2936 KB |
Output is correct |
8 |
Correct |
14 ms |
2936 KB |
Output is correct |
9 |
Correct |
15 ms |
2936 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
2936 KB |
Output is correct |
2 |
Correct |
17 ms |
2936 KB |
Output is correct |
3 |
Correct |
17 ms |
2936 KB |
Output is correct |
4 |
Correct |
24 ms |
3064 KB |
Output is correct |
5 |
Correct |
18 ms |
2936 KB |
Output is correct |
6 |
Correct |
17 ms |
2940 KB |
Output is correct |
7 |
Correct |
17 ms |
2936 KB |
Output is correct |
8 |
Correct |
16 ms |
2912 KB |
Output is correct |
9 |
Correct |
17 ms |
2936 KB |
Output is correct |
10 |
Correct |
19 ms |
2936 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
2936 KB |
Output is correct |
2 |
Correct |
14 ms |
2936 KB |
Output is correct |
3 |
Correct |
836 ms |
12920 KB |
Output is correct |
4 |
Correct |
928 ms |
13908 KB |
Output is correct |
5 |
Correct |
190 ms |
5056 KB |
Output is correct |
6 |
Correct |
922 ms |
14044 KB |
Output is correct |
7 |
Correct |
17 ms |
2936 KB |
Output is correct |
8 |
Correct |
16 ms |
2936 KB |
Output is correct |
9 |
Correct |
18 ms |
2936 KB |
Output is correct |
10 |
Correct |
15 ms |
2936 KB |
Output is correct |
11 |
Correct |
21 ms |
2936 KB |
Output is correct |
12 |
Correct |
14 ms |
2936 KB |
Output is correct |
13 |
Correct |
15 ms |
2936 KB |
Output is correct |
14 |
Correct |
14 ms |
2936 KB |
Output is correct |
15 |
Correct |
15 ms |
2936 KB |
Output is correct |
16 |
Correct |
15 ms |
2936 KB |
Output is correct |
17 |
Correct |
17 ms |
2936 KB |
Output is correct |
18 |
Correct |
17 ms |
2936 KB |
Output is correct |
19 |
Correct |
24 ms |
3064 KB |
Output is correct |
20 |
Correct |
18 ms |
2936 KB |
Output is correct |
21 |
Correct |
17 ms |
2940 KB |
Output is correct |
22 |
Correct |
17 ms |
2936 KB |
Output is correct |
23 |
Correct |
16 ms |
2912 KB |
Output is correct |
24 |
Correct |
17 ms |
2936 KB |
Output is correct |
25 |
Correct |
19 ms |
2936 KB |
Output is correct |
26 |
Correct |
64 ms |
3704 KB |
Output is correct |
27 |
Correct |
890 ms |
13660 KB |
Output is correct |
28 |
Correct |
903 ms |
14152 KB |
Output is correct |
29 |
Correct |
357 ms |
8816 KB |
Output is correct |
30 |
Correct |
593 ms |
12160 KB |
Output is correct |
31 |
Correct |
112 ms |
4528 KB |
Output is correct |
32 |
Correct |
83 ms |
3900 KB |
Output is correct |
33 |
Correct |
552 ms |
11676 KB |
Output is correct |
34 |
Correct |
536 ms |
11140 KB |
Output is correct |
35 |
Correct |
604 ms |
12352 KB |
Output is correct |
36 |
Correct |
634 ms |
12380 KB |
Output is correct |
37 |
Correct |
16 ms |
2936 KB |
Output is correct |