Created
July 3, 2015 21:34
-
-
Save StarOrpheus/d7aa73e4b661a167ddc9 to your computer and use it in GitHub Desktop.
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
import json | |
import requests | |
import sys | |
fout = open('log.txt', 'w') | |
r = requests.get('http://codeforces.com/api/user.status', params={'handle' : 'Jyree'}) | |
info = json.loads(r.text) | |
if(info['status'] != 'OK'): | |
print('Fail :c') | |
sys.exit(0) | |
info = info['result'] | |
count = 0 | |
def wrlog(s): | |
fout.write(s + '\n') | |
for tr in info: | |
if(tr['verdict'] == 'OK'): | |
count += 1 | |
wrlog(str(tr['problem']['contestId']) + tr['problem']['index']) | |
wrlog('='*25) | |
wrlog(str(count)) | |
fout.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment