Жигалов Никита Сергеевич 325 PairNumber 6714 | Конев Артём Александрович 527 PairNumber 7329 | ||||
---|---|---|---|---|---|
n | 1 | c = input() | n | 1 | s = input() |
2 | words = [] | 2 | words = [] | ||
n | 3 | while c: | n | 3 | while s: |
4 | words += c.split() | 4 | words += s.split() | ||
5 | c = input() | 5 | s = input() | ||
6 | pairs = set() | 6 | rez = set() | ||
7 | for i in range(len(words) - 1): | 7 | for i in range(len(words) - 1): | ||
t | 8 | pairs.add(frozenset((words[i], words[i + 1]))) | t | 8 | rez.add(frozenset((words[i], words[i + 1]))) |
9 | print(len(pairs)) | 9 | print(len(rez)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|