Task: | LibBot |
Sender: | aalto2024b_009 |
Submission time: | 2024-09-11 17:39:01 +0300 |
Language: | Python3 (PyPy3) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.08 s | details |
#2 | WRONG ANSWER | 0.08 s | details |
#3 | WRONG ANSWER | 0.08 s | details |
#4 | WRONG ANSWER | 0.08 s | details |
#5 | WRONG ANSWER | 0.08 s | details |
#6 | WRONG ANSWER | 0.08 s | details |
#7 | WRONG ANSWER | 0.08 s | details |
#8 | WRONG ANSWER | 0.08 s | details |
#9 | WRONG ANSWER | 0.08 s | details |
#10 | WRONG ANSWER | 0.08 s | details |
#11 | WRONG ANSWER | 0.08 s | details |
#12 | WRONG ANSWER | 0.08 s | details |
#13 | WRONG ANSWER | 0.08 s | details |
#14 | WRONG ANSWER | 0.08 s | details |
#15 | WRONG ANSWER | 0.08 s | details |
#16 | WRONG ANSWER | 0.08 s | details |
#17 | WRONG ANSWER | 0.08 s | details |
#18 | WRONG ANSWER | 0.08 s | details |
#19 | WRONG ANSWER | 0.08 s | details |
#20 | WRONG ANSWER | 0.08 s | details |
#21 | WRONG ANSWER | 0.08 s | details |
#22 | WRONG ANSWER | 0.08 s | details |
#23 | WRONG ANSWER | 0.08 s | details |
#24 | WRONG ANSWER | 0.08 s | details |
#25 | WRONG ANSWER | 0.08 s | details |
#26 | WRONG ANSWER | 0.08 s | details |
#27 | WRONG ANSWER | 0.08 s | details |
#28 | WRONG ANSWER | 0.08 s | details |
#29 | WRONG ANSWER | 0.08 s | details |
#30 | WRONG ANSWER | 0.08 s | details |
#31 | WRONG ANSWER | 0.08 s | details |
#32 | WRONG ANSWER | 0.08 s | details |
#33 | WRONG ANSWER | 0.08 s | details |
#34 | WRONG ANSWER | 0.07 s | details |
#35 | WRONG ANSWER | 0.08 s | details |
#36 | WRONG ANSWER | 0.07 s | details |
#37 | WRONG ANSWER | 0.08 s | details |
#38 | WRONG ANSWER | 0.08 s | details |
#39 | WRONG ANSWER | 0.07 s | details |
#40 | WRONG ANSWER | 0.07 s | details |
#41 | WRONG ANSWER | 0.08 s | details |
Code
import sys sys.setrecursionlimit(10 ** 6) n = int(input()) g = [[] for i in range(n)] for i in range(n - 1): a, b = map(int, input().split()) g[a - 1].append(b - 1) g[b - 1].append(a - 1) root = 1 sums = [-1] * n visited = [False] * n parents = [-1] * n def dfs(node): global sums if visited[node]: return visited[node] = True flag = 0 for w in g[node]: if not visited[w]: parents[w] = node dfs(w) flag += sums[w] sums[node] = flag + 1 dfs(root) k = n // 2 f = False for i in range(n): if sums[i] == k: s = i # print('S', s) f = True break if f: print('Yes') m = [False] * n visited = [False] * n visited[parents[s]] = True def dfs2(node): global m if visited[node]: return visited[node] = True for w in g[node]: if not visited[w]: m[w] = True dfs2(w) dfs2(s) # print(m) m[s] = True for j in range(n): if m[j]: print('M', end='') else: print('U', end='') print() else: print('No')
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
2 9 kdg dl 6 kdg 3 kdgwl 1 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 2 COUNT kdg |
Error:
1 1 0 1
Test 2
Verdict: WRONG ANSWER
input |
---|
3 15 irwkfl c 26 d 27 e 11 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 3 COUNT irwkfl |
Error:
1 1 0 1
Test 3
Verdict: WRONG ANSWER
input |
---|
4 34 gcnmkobrd bcytu 60 bheb 64 bhebp 26 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT gcnmkobrd |
Error:
1 1 0 1
Test 4
Verdict: WRONG ANSWER
input |
---|
5 52 faoluuicsn a 1 cufqs 30 d 44 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 5 COUNT faoluuicsn |
Error:
1 1 0 1
Test 5
Verdict: WRONG ANSWER
input |
---|
6 75 okokxlluuicsnw a 1 b 51 bxcufq 145 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 6 COUNT okokxlluuicsnw |
Error:
1 1 0 1
Test 6
Verdict: WRONG ANSWER
input |
---|
7 105 jibgewnvmqnpbxvirxmgf a 1 aqykhme 32 atusxwa 119 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT jibgewnvmqnpbxvirxmgf |
Error:
1 1 0 1
Test 7
Verdict: WRONG ANSWER
input |
---|
8 124 djnofmgdbfj afpc 66 apj 204 apjgsu 105 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT djnofmgdbfj |
Error:
1 1 0 1
Test 8
Verdict: WRONG ANSWER
input |
---|
9 166 qonvyqgibutxey a 94 act 683 afngrwb 20 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT qonvyqgibutxey |
Error:
1 1 0 1
Test 9
Verdict: WRONG ANSWER
input |
---|
10 211 zuek axof 303 axofdxjyeevjxifd 397 axofvxnleg 539 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 10 COUNT zuek |
Error:
1 1 0 1
Test 10
Verdict: WRONG ANSWER
input |
---|
10 216 hskapswvzfrbijqwgotkothu aayuulyq 436 aayuulyqcs 205 aayuulyqcsgjqffbfix 530 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 10 COUNT hskapswvzfrbijqwgotkothu |
Error:
1 1 0 1
Test 11
Verdict: WRONG ANSWER
input |
---|
9 158 ylhjecnhgyboje a 691 acd 241 apkcczfzzxrpvlk 88 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT ylhjecnhgyboje |
Error:
1 1 0 1
Test 12
Verdict: WRONG ANSWER
input |
---|
8 133 ewcm aavhwtselm 486 aavrwtsejm 170 aayuuly 62 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT ewcm |
Error:
1 1 0 1
Test 13
Verdict: WRONG ANSWER
input |
---|
7 98 jkpxbvb awb 326 comccswxez 114 cw 42 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT jkpxbvb |
Error:
1 1 0 1
Test 14
Verdict: WRONG ANSWER
input |
---|
6 70 eaymki alkio 119 alkioruv 72 alkioruvyivod 26 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 6 COUNT eaymki |
Error:
1 1 0 1
Test 15
Verdict: WRONG ANSWER
input |
---|
4 28 unje biybsjet 60 biybsjetnn 27 bx 45 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT unje |
Error:
1 1 0 1
Test 16
Verdict: WRONG ANSWER
input |
---|
9 159 ckfhsouqxvv a 373 aahay 152 asvvihxxokcevotlncilqbuvhmdkmh... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT ckfhsouqxvv |
Error:
1 1 0 1
Test 17
Verdict: WRONG ANSWER
input |
---|
8 117 h aaha 262 anmuhfjbetlfzdbns 107 awhfbhdbjbuexgbwl 226 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT h |
Error:
1 1 0 1
Test 18
Verdict: WRONG ANSWER
input |
---|
7 106 m aezpq 42 aokpn 7 aqfkfe 86 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT m |
Error:
1 1 0 1
Test 19
Verdict: WRONG ANSWER
input |
---|
7 101 kvtwj appvlr 240 bguzpylrzkwon 78 bofd 2 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT kvtwj |
Error:
1 1 0 1
Test 20
Verdict: WRONG ANSWER
input |
---|
2 9 fu dl 6 kdg 3 kdgwl 1 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 2 COUNT fu |
Error:
1 1 0 1
Test 21
Verdict: WRONG ANSWER
input |
---|
3 15 uvk c 26 d 27 e 11 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 3 COUNT uvk |
Error:
1 1 0 1
Test 22
Verdict: WRONG ANSWER
input |
---|
4 34 jgtx bcytu 60 bheb 64 bhebp 26 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT jgtx |
Error:
1 1 0 1
Test 23
Verdict: WRONG ANSWER
input |
---|
5 52 ghmfq a 1 cufqs 30 d 44 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 5 COUNT ghmfq |
Error:
1 1 0 1
Test 24
Verdict: WRONG ANSWER
input |
---|
6 75 ojuphd a 1 b 51 bxcufq 145 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 6 COUNT ojuphd |
Error:
1 1 0 1
Test 25
Verdict: WRONG ANSWER
input |
---|
7 105 kzzqfzz a 1 aqykhme 32 atusxwa 119 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT kzzqfzz |
Error:
1 1 0 1
Test 26
Verdict: WRONG ANSWER
input |
---|
8 124 emdxvwdw afpc 66 apj 204 apjgsu 105 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT emdxvwdw |
Error:
1 1 0 1
Test 27
Verdict: WRONG ANSWER
input |
---|
9 166 pkhsbasuj a 94 act 683 afngrwb 20 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT pkhsbasuj |
Error:
1 1 0 1
Test 28
Verdict: WRONG ANSWER
input |
---|
10 211 zypqadmqoo axof 303 axofdxjyeevjxifd 397 axofvxnleg 539 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 10 COUNT zypqadmqoo |
Error:
1 1 0 1
Test 29
Verdict: WRONG ANSWER
input |
---|
10 216 jhagispreh aayuulyq 436 aayuulyqcs 205 aayuulyqcsgjqffbfix 530 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 10 COUNT jhagispreh |
Error:
1 1 0 1
Test 30
Verdict: WRONG ANSWER
input |
---|
9 158 zfkmqpzht a 691 acd 241 apkcczfzzxrpvlk 88 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT zfkmqpzht |
Error:
1 1 0 1
Test 31
Verdict: WRONG ANSWER
input |
---|
8 133 dogiavnu aavhwtselm 486 aavrwtsejm 170 aayuuly 62 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT dogiavnu |
Error:
1 1 0 1
Test 32
Verdict: WRONG ANSWER
input |
---|
7 98 kihqiff awb 326 comccswxez 114 cw 42 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT kihqiff |
Error:
1 1 0 1
Test 33
Verdict: WRONG ANSWER
input |
---|
6 70 eszubi alkio 119 alkioruv 72 alkioruvyivod 26 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 6 COUNT eszubi |
Error:
1 1 0 1
Test 34
Verdict: WRONG ANSWER
input |
---|
4 28 vyta biybsjet 60 biybsjetnn 27 bx 45 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT vyta |
Error:
1 1 0 1
Test 35
Verdict: WRONG ANSWER
input |
---|
9 159 ctohjykey a 373 aahay 152 asvvihxxokcevotlncilqbuvhmdkmh... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT ctohjykey |
Error:
1 1 0 1
Test 36
Verdict: WRONG ANSWER
input |
---|
8 117 igjxpndn aaha 262 anmuhfjbetlfzdbns 107 awhfbhdbjbuexgbwl 226 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT igjxpndn |
Error:
1 1 0 1
Test 37
Verdict: WRONG ANSWER
input |
---|
7 106 lslhnht aezpq 42 aokpn 7 aqfkfe 86 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT lslhnht |
Error:
1 1 0 1
Test 38
Verdict: WRONG ANSWER
input |
---|
7 101 hxliesh appvlr 240 bguzpylrzkwon 78 bofd 2 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT hxliesh |
Error:
1 1 0 1
Test 39
Verdict: WRONG ANSWER
input |
---|
2 1 fu dl 32 |
correct output |
---|
(empty) |
user output |
---|
SIZE 2 COUNT fu |
Error:
1 1 0 1
Test 40
Verdict: WRONG ANSWER
input |
---|
3 1 fuuicsxvc fuuicsxvc 243 |
correct output |
---|
(empty) |
user output |
---|
SIZE 3 COUNT fuuicsxvc |
Error:
1 1 0 1
Test 41
Verdict: WRONG ANSWER
input |
---|
4 1 bcytu bcytu 1024 |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT bcytu |
Error:
1 1 0 1