Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.026 s | 3 KBi |
#2 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.015 s | 3 KBi |
#3 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
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 16, in <module> parent = arbol[child] KeyError: '0' |
0.01 s | 3 KBi |
#5 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.008 s | 3 KBi |
#6 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.01 s | 3 KBi |
#7 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.01 s | 3 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.01 s | 3 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.009 s | 3 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.02 s | 3 KBi |
#11 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.01 s | 3 KBi |
#12 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.426 s | 21 KBi |
#13 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.149 s | 21 KBi |
#14 |
Incorrecto
|
0.254 s | 21 KBi |
#15 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 16, in <module> parent = arbol[child] KeyError: '0' |
0.172 s | 21 KBi |
#16 |
Incorrecto
|
0.237 s | 21 KBi |
#17 |
Incorrecto
|
0.241 s | 21 KBi |
#18 |
Incorrecto
|
0.199 s | 21 KBi |
#19 |
Incorrecto
|
0.244 s | 21 KBi |
#20 |
Incorrecto
|
0.211 s | 21 KBi |
N = int(input()) arbol = {} for i in range(N-1): arbolData = input().split() #[0, 1] 0 is ancestor and 1 is child # key=child and value=parent {'1':'0'} arbol[arbolData[1]] = arbolData[0] c = int(input()) for i in range(c): query = input().split(' ') ancestor = query[0] child = query[1] parent = arbol[child] if ancestor == child: print('Yes') elif parent == ancestor: print('Yes') else: print('No')