Хомич Дарья Максимовна, 530 AlmostRandom 18186 | Бислан Ашинов, 530 группа AlmostRandom 6911 | ||||
---|---|---|---|---|---|
f | 1 | import random | f | 1 | import random |
2 | 2 | ||||
3 | def divrandom(a, b, s, p): | 3 | def divrandom(a, b, s, p): | ||
t | 4 | for i in range(500): | t | 4 | for i in range(1000): |
5 | x = random.randrange(min(a, b), max(a, b) + 1, s) | 5 | some_rand = random.randrange(min(a, b), max(a, b) + 1, s) | ||
6 | if x % p != 0: | 6 | if some_rand % p != 0: | ||
7 | return x | 7 | return some_rand | ||
8 | return 0 | 8 | return 0 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|