Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- a = int(input())
- arr = []
- for i in range(a):
- t = input().split(',')
- count = 0
- c = set()
- for i in range(3):
- for x in t[i]:
- if not x in c:
- count += 1
- c.add(x)
- """c = [False] * 52
- for i in range(3):
- for x in t[i]:
- if 'A' <= x <= 'Z':
- if not c[ord(x) - ord('A')]:
- count += 1
- c[ord(x) - ord('A')] = True
- else:
- if not c[ord(x) - ord('a') + 26]:
- count += 1
- c[ord(x) - ord('a') + 26] = True"""
- c2 = 0
- for i in range(3, 5):
- for x in t[i]:
- c2 += int(x)
- c2 *= 64
- c3 = ord(t[0][0]) - ord('A') + 1 if 'A' <= t[0][0] <= 'Z' else ord(t[0][0]) - ord('a') + 1
- c3 *= 256
- res = count + c2 + c3
- tmp = 16 * 16
- res %= tmp * 16
- s = ""
- while not tmp == 0:
- i = res // tmp
- res %= tmp
- #print(i)
- if i < 10:
- s += str(i)
- else:
- s += chr(ord('A') + i % 10)
- tmp //= 16
- print(s, end=' ')
- if __name__ == '__main__':
- main()
- #abc,ABC,sda,23,01,2005
- #Volozh,Arcady,Yurievich,11,2,1964
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement