Галустов Артемий Львович, 527 LookSay 9370 | Меркушев Александр, группа 528 LookSay 9583 | ||||
---|---|---|---|---|---|
f | 1 | from itertools import groupby | f | 1 | from itertools import groupby |
2 | 2 | ||||
3 | def LookSay(): | 3 | def LookSay(): | ||
n | 4 | i = '1' | n | 4 | cur = '1' |
5 | while True: | 5 | while True: | ||
t | 6 | for el in i: | t | 6 | for didit in cur: |
7 | yield int(el) | 7 | yield int(didit) | ||
8 | i = ''.join((str(len(list(s))) + l for l, s in groupby(i))) | 8 | cur = ''.join([str(len(list(g))) + k for k, g in groupby(cur)]) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|