Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.015 s | 3 KBi |
#2 |
Incorrecto
|
0.01 s | 3 KBi |
#3 |
Incorrecto
|
0.01 s | 3 KBi |
#4 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 19, in <module> parent = arbol[child] KeyError: '0' |
0.027 s | 3 KBi |
#5 |
Incorrecto
|
0.017 s | 3 KBi |
#6 |
Incorrecto
|
0.011 s | 3 KBi |
#7 |
Incorrecto
|
0.013 s | 3 KBi |
#8 |
Incorrecto
|
0.027 s | 3 KBi |
#9 |
Incorrecto
|
0.013 s | 3 KBi |
#10 |
Incorrecto
|
0.015 s | 3 KBi |
#11 |
Incorrecto
|
0.014 s | 3 KBi |
#12 |
Incorrecto
|
0.138 s | 21 KBi |
#13 |
Incorrecto
|
0.172 s | 21 KBi |
#14 |
Incorrecto
|
0.501 s | 21 KBi |
#15 |
Incorrecto
|
0.17 s | 21 KBi |
#16 |
Incorrecto
|
0.156 s | 21 KBi |
#17 |
Incorrecto
|
0.137 s | 21 KBi |
#18 |
Incorrecto
|
0.438 s | 21 KBi |
#19 |
Incorrecto
|
0.157 s | 21 KBi |
#20 |
Incorrecto
|
0.159 s | 21 KBi |
N = int(input()) arbol = {} for i in range(N-1): arbolData = input().split() arbol['0'] = None arbol[arbolData[1]] = arbolData[0] c = int(input()) for i in range(c): query = input().split(' ') ancestor = query[0] child = query[1] if ancestor == child: print('Yes') parent = arbol[child] if parent is None: print('No') elif parent == ancestor: print('Yes')