Астраханцев Дмитрий 321 ShuffleString 2165 | Юрий Савиных, 527 группа ShuffleString 2236 | ||||
---|---|---|---|---|---|
f | 1 | s1 = input() | f | 1 | s1 = input() |
2 | s2 = input() | 2 | s2 = input() | ||
t | 3 | shuffle = [''.join([s1[j::i] for j in range(i)]) for i in range(1, len(s1))] | t | 3 | permutations = [''.join([s1[j::i] for j in range(i)]) for i in range(1, len(s1))] |
4 | if s2 in shuffle: | 4 | if s2 in permutations: | ||
5 | print(shuffle.index(s2) + 1) | 5 | print(permutations.index(s2) + 1) | ||
6 | else: | 6 | else: | ||
7 | print('No') | 7 | print('No') |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|