← Back to List

14467번: 소가 길을 건너간 이유 1 ↗

Solutions

Python 3
202 B | 202 chars
s=0
dic = dict()
for _ in range(int(input())):
    a,b=map(int,input().split(" "))
    if a in dic:
        if dic[a] != b:
            s+=1
            dic[a] = b
    else:
        dic[a] = b

print(s)