Skip to content

Instantly share code, notes, and snippets.

@naoyat naoyat/randsrm.py Secret
Last active Jun 3, 2017

Embed
What would you like to do?
SRM problem random picker
#!/usr/bin/env python
import random
import click
srm_without_editorial = (
252,
471, 474, 478, 482, 485, 489, 491, 494,
501, 505, 582,
644, 689, 693, 694, 695, 696, 698,
703, 704, 705, 706, 707, 708, 709
)
rational = ( # not included yet
453.5, 504.5, 526.5,
)
@click.command()
@click.option('--since', type=int, default=400)
def main(since):
since = max(144, since) # 144 = the oldest SRM available in practice room
while True:
r = random.randint(since, 710)
if r in srm_without_editorial:
continue
print 'SRM%d' % r
break
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.