JudgeServer
JudgeServer copied to clipboard
请问能否给个JudgeServer /judge的请求样例
您好,请问是否发一份JudgeServer /judge的请求样例
或者能不能帮我看看这是什么问题?
{ "src": "#include<stdio.h> int main() {int a,b; scanf(\"%d%d\", &a,&b); printf(\"%d\", a+b); return 0;}", "language_config": { "compile": { "src_name": "main.c", "exe_name": "main", "max_cpu_time": 3000, "max_real_time": 5000, "max_memory": 134217728, "compile_command": "/usr/bin/gcc -DONLINE_JUDGE -O2 -w -fmax-errors=3 -std=c99 {src_path} -lm -o {exe_path}" }, "run": { "command": "{exe_path}", "seccomp_rule": "c_cpp", "env": ["LANG=en_US.UTF-8", "LANGUAGE=en_US:en", "LC_ALL=en_US.UTF-8"] } }, "max_cpu_time": 3000, "max_memory": 134217728, "test_case_id": "normal", "output": "false" }
返回的响应是:
{ "err": "CompileError", "data": "/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function
_start':\n(.text+0x20): undefined reference to main'\ncollect2: error: ld returned 1 exit status" }
感觉就是你的 c 代码错了,上面的 json 不知道是换行没了还是就没有换行啊,int main
另起一行看看
感觉就是你的 c 代码错了,上面的 json 不知道是换行没了还是就没有换行啊,
int main
另起一行看看
谢谢你,我解决掉了,我把命令中-std=c99 换成了-c 就可以了。那个能给我一份请求事例吗?a+b的那种,我现在正常返回了但是 err=null;output_md5也是null;"result": 4
看 https://github.com/QingdaoU/JudgeServer/blob/master/client/Python/client.py
看 https://github.com/QingdaoU/JudgeServer/blob/master/client/Python/client.py
好的,太感谢你了!
请教下 testcase id 怎么获取呢?
正在整理 issue 與 PR,有需要再重新打開或開新的 issue 吧。