Submission #801867

# Submission time Handle Problem Language Result Execution time Memory
801867 2023-08-02T08:10:52 Z Trisanu_Das Elder (COCI19_elder) Python 3
50 / 50
14 ms 2828 KB
w = input()
n = int(input())
o = {w}
for i in range(n):
    ww, l = input().split()
    if l == w:
        w = ww
        o.add(w)
print(w)
print(len(o))
# Verdict Execution time Memory Grader output
1 Correct 12 ms 2708 KB Output is correct
2 Correct 13 ms 2792 KB Output is correct
3 Correct 12 ms 2776 KB Output is correct
4 Correct 10 ms 2772 KB Output is correct
5 Correct 12 ms 2824 KB Output is correct
6 Correct 14 ms 2772 KB Output is correct
7 Correct 14 ms 2828 KB Output is correct
8 Correct 14 ms 2772 KB Output is correct
9 Correct 14 ms 2772 KB Output is correct
10 Correct 11 ms 2704 KB Output is correct