Created
April 30, 2018 06:39
-
-
Save tjkendev/5ea64f1902fd90c5485dd54f6982e4f0 to your computer and use it in GitHub Desktop.
ACした問題の中でPythonでACしていない問題を列挙
This file contains 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
# AtCoder: ACした問題の中でPythonでACしていない問題を列挙 | |
# "https://kenkoooo.com/atcoder/atcoder-api/results?user=(ユーザー名)"のデータを"results.txt"として保存して利用 | |
import json, re | |
with open('results.txt', 'r') as f: | |
txt = f.read() | |
data = json.loads(txt) | |
ps = {} | |
qs = {} | |
problems = {} | |
c = re.compile('^Python') | |
acs = [d for d in json.loads(txt) if d['result'] == 'AC'] | |
for d in acs: | |
if c.match(d['language']): | |
ps[d['contest_id'], d['problem_id']] = d | |
else: | |
qs[d['contest_id'], d['problem_id']] = d | |
problems.setdefault((d['contest_id'], d['problem_id']), []).append(d) | |
p_ids = set(ps.keys()) & set(qs.keys()) | |
p_ids = sorted(p_ids) | |
print("# of problems which do not solve in Python:", len(p_ids)) | |
for p_id in p_ids: | |
problem = problems[p_id] | |
print(p_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment