답안 #161503

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
161503 2019-11-02T17:41:27 Z boolodifjenula Elder (COCI19_elder) Python 3
50 / 50
27 ms 3428 KB
ima=input()
N=int(input())
k=1
L=[ima]
for i in range (N):
    Z1,Z2=map(str,input().split())
    if Z2==ima:
        ima=Z1
        if bool(Z1 in L)==0:
            k+=1
            L+=[Z1]
print(ima)
print(k)
    
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 3300 KB Output is correct
2 Correct 26 ms 3300 KB Output is correct
3 Correct 27 ms 3328 KB Output is correct
4 Correct 26 ms 3428 KB Output is correct
5 Correct 26 ms 3300 KB Output is correct
6 Correct 27 ms 3300 KB Output is correct
7 Correct 25 ms 3300 KB Output is correct
8 Correct 27 ms 3300 KB Output is correct
9 Correct 24 ms 3300 KB Output is correct
10 Correct 25 ms 3300 KB Output is correct