Skip to content

Instantly share code, notes, and snippets.

@naoyat
Last active June 3, 2017 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naoyat/3a1baaeb45992b7a9d181c50e03986d3 to your computer and use it in GitHub Desktop.
Save naoyat/3a1baaeb45992b7a9d181c50e03986d3 to your computer and use it in GitHub Desktop.
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