Михаил Гарриевич Делба , 525 группа AlmostRandom 8132 | Сергей Трубецкой, 522 группа AlmostRandom 5343 | ||||
---|---|---|---|---|---|
f | 1 | import random | f | 1 | import random |
2 | 2 | ||||
3 | def divrandom(a, b, s, p): | 3 | def divrandom(a, b, s, p): | ||
4 | if a > b: | 4 | if a > b: | ||
n | 5 | temp = a | n | 5 | c = a |
6 | a = b | 6 | a = b | ||
t | 7 | b = temp | t | 7 | b = c |
8 | for i in range(1000): | 8 | for i in range(100): | ||
9 | n = random.randrange(a, b + 1, s) | 9 | n = random.randrange(a, b + 1, s) | ||
10 | if n % p != 0: | 10 | if n % p != 0: | ||
11 | return n | 11 | return n | ||
12 | return 0 | 12 | return 0 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|