You are viewing a single comment's thread. Return to all comments →
Python to the rescue...
counts = [0]*100 for i in range(int(input())): m,d = map(int,input().split()) try:counts[int(str(d),m)]+=1 except:pass print(sum(c*(c-1)//2 for c in counts))
Seems like cookies are disabled on this browser, please enable them to open this website
Jim and the Jokes
You are viewing a single comment's thread. Return to all comments →
Python to the rescue...