| Зарипов Андрей, 125ая LookSay 4619 | Антипова Алёна 425 гр. LookSay 4699 | ||||
|---|---|---|---|---|---|
| f | 1 | from itertools import groupby | f | 1 | from itertools import groupby |
| 2 | 2 | ||||
| 3 | def LookSay(): | 3 | def LookSay(): | ||
| n | 4 | elems = '1' | n | 4 | s = '1' |
| 5 | while True: | 5 | while True: | ||
| t | 6 | for e in elems: | t | 6 | for c in s: |
| 7 | yield int(e) | 7 | yield int(c) | ||
| 8 | elems = ''.join((str(len(list(n))) + e for e, n in groupby(elems | 8 | s = ''.join((str(len(list(count))) + num for num, count in group | ||
| > | ))) | > | by(s))) | ||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||