Skip to content

Instantly share code, notes, and snippets.

@StarOrpheus
Created July 3, 2015 21:34
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 StarOrpheus/d7aa73e4b661a167ddc9 to your computer and use it in GitHub Desktop.
Save StarOrpheus/d7aa73e4b661a167ddc9 to your computer and use it in GitHub Desktop.
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