Create automated script that runs and checks submitted codes, based on problem link mentioned
{
"status": true,
"model": {
"id": 888199165,
"status": 1,
"challenge_id": 24432,
"contest_id": 1,
"hacker_id": 277890,
"kind": "code",
"actors": null,
"customtestcase": false,
"upload_url": null,
"stdin_url": [],
"expected_output_url": [],
"stdin": [
"6 4\ngive me one grand today night\ngive one grand today",
"6 5\ntwo times three is not four\ntwo times two is four",
"7 4\nive got a lovely bunch of coconuts\nive got some coconuts"
],
"stdout": [
"Yes",
"No",
"No"
],
"stderr": [
"",
"",
""
],
"signal": [
0,
0,
0
],
"testcase_message": [
"Success",
"Success",
"Success"
],
"testcase_status": [
1,
1,
1
],
"custom_score": null,
"result": 0,
"memory": [
9228,
9012,
9264
],
"time": [
0.033960448,
0.0319778,
0.028092911
],
"compilemessage": "",
"expected_output": [
"Yes",
"No",
"No"
],
"error_markers": null,
"compile_command": "g++ -g -Wall -Wno-unused-result -Werror=return-type -Werror=main -pipe -O2 -D_FORTIFY_SOURCE=2 -fno-delete-null-pointer-checks -std=c++11 -I/usr/include/jsoncpp Solution.cpp -o Solution -L/usr/include/jsoncpp -lm -lpthread -ljsoncpp -lcurl",
"stdout_debug": [
"",
"",
""
],
"time_limit": 2,
"customchecker_message": null,
"error_code": 0,
"sample_test_cases_index": [
0,
20,
21
],
"status_string": {
"live_message": "Fetching Results",
"codechecker_signal": [
0,
0,
0
],
"progress": 6,
"progress_states": 6,
"testcase_status": [
1,
1,
1
],
"testcase_message": [
"Success",
"Success",
"Success"
],
"custom_score": null
},
"trimmed_fields": []
}
}
Create automated script that runs and checks submitted codes, based on problem link mentioned
eg api
curl 'https://www.hackerrank.com/rest/contests/master/challenges/ctci-ransom-note/compile_tests/888199165'
-H 'authority: www.hackerrank.com'
-H 'pragma: no-cache'
-H 'cache-control: no-cache'
-H 'accept: application/json'
-H 'x-csrf-token: GENERATE_CSRF_TOKEN'
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 OPR/71.0.3770.228'
-H 'content-type: application/json'
-H 'sec-fetch-site: same-origin'
-H 'sec-fetch-mode: cors'
-H 'sec-fetch-dest: empty'
-H 'cookie: GENERATE_COOKIE'
--compressed
Response example-
{ "status": true, "model": { "id": 888199165, "status": 1, "challenge_id": 24432, "contest_id": 1, "hacker_id": 277890, "kind": "code", "actors": null, "customtestcase": false, "upload_url": null, "stdin_url": [], "expected_output_url": [], "stdin": [ "6 4\ngive me one grand today night\ngive one grand today", "6 5\ntwo times three is not four\ntwo times two is four", "7 4\nive got a lovely bunch of coconuts\nive got some coconuts" ], "stdout": [ "Yes", "No", "No" ], "stderr": [ "", "", "" ], "signal": [ 0, 0, 0 ], "testcase_message": [ "Success", "Success", "Success" ], "testcase_status": [ 1, 1, 1 ], "custom_score": null, "result": 0, "memory": [ 9228, 9012, 9264 ], "time": [ 0.033960448, 0.0319778, 0.028092911 ], "compilemessage": "", "expected_output": [ "Yes", "No", "No" ], "error_markers": null, "compile_command": "g++ -g -Wall -Wno-unused-result -Werror=return-type -Werror=main -pipe -O2 -D_FORTIFY_SOURCE=2 -fno-delete-null-pointer-checks -std=c++11 -I/usr/include/jsoncpp Solution.cpp -o Solution -L/usr/include/jsoncpp -lm -lpthread -ljsoncpp -lcurl", "stdout_debug": [ "", "", "" ], "time_limit": 2, "customchecker_message": null, "error_code": 0, "sample_test_cases_index": [ 0, 20, 21 ], "status_string": { "live_message": "Fetching Results", "codechecker_signal": [ 0, 0, 0 ], "progress": 6, "progress_states": 6, "testcase_status": [ 1, 1, 1 ], "testcase_message": [ "Success", "Success", "Success" ], "custom_score": null }, "trimmed_fields": [] } }