Казантаев Алексей 619/2 AlmostRandom 6503 | Stanislav AlmostRandom 6246 | ||||
---|---|---|---|---|---|
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: | ||
5 | a, b = (b, a) | 5 | a, b = (b, a) | ||
t | 6 | for _ in range(1000): | t | 6 | for _ in range(100): |
7 | value = random.randrange(a, b + 1, s) | 7 | num = random.randrange(a, b + 1, s) | ||
8 | if value % p != 0: | 8 | if num % p != 0: | ||
9 | return value | 9 | return num | ||
10 | return 0 | 10 | return 0 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|