Skip to content

Instantly share code, notes, and snippets.

@khanh96le
Created June 21, 2018 04:12
Show Gist options
  • Save khanh96le/fda8ea78218a512456f256d287da396a to your computer and use it in GitHub Desktop.
Save khanh96le/fda8ea78218a512456f256d287da396a to your computer and use it in GitHub Desktop.
import json
import requests
ID = 'AGGRCOW'
url = 'http://spojtoolkit.com/src-drivers/ExecuteCodeOnAPI-driver.php'
with open('{}.txt'.format(ID), 'r') as f:
input = f.read()
data = {
'problemId': '{}'.format(ID),
'testInput': input,
'timeLimit': 1,
'type': 'codeTest',
'cache': 1
}
r = requests.post(url, data=data)
print(r)
content = json.loads(r.content)
for key in content.keys():
print(key, "\t", content[key])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment