Last active
August 4, 2020 00:33
-
-
Save omas-public/f76af766ecebcda7da6066c2ba1818b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
create_class = lambda prefix, n: [ f'{prefix}{i + 1:03}' for i in range(n)] | |
base = 'https://judgeapi.u-aizu.ac.jp/users/' | |
header = ['name', 'solved', 'submissions'] | |
users = create_class('s20', 24) + create_class('n20', 30) | |
print(header) | |
for user in users: | |
res = json.loads(requests.get(base + user).text) | |
if type(res) is dict : | |
print(','.join([res['name'], str(res['status']['solved']), str(res['status']['submissions'])])) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment