From 9f8202ffdcb5f39a3be09ede62eadd7996d49699 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Mon, 2 May 2016 21:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=99=A8=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E9=99=90=E5=88=B6=E6=94=BE=E5=85=A5=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge/compiler.py | 4 ++-- judge/language.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/judge/compiler.py b/judge/compiler.py index 1aa5e0e..266b9e8 100644 --- a/judge/compiler.py +++ b/judge/compiler.py @@ -15,8 +15,8 @@ def compile_(language_item, src_path, exe_path, judge_base_path, compile_spj=Fal compile_result = judger.run(path=compiler, in_file="/dev/null", out_file=compiler_output_file, - max_cpu_time=2000, - max_memory=256 * 1024 * 1024, + max_cpu_time=language_item["compile_max_cpu_time"], + max_memory=language_item["compile_max_memory"], args=compile_args, env=["PATH=" + os.environ["PATH"]], use_sandbox=False, diff --git a/judge/language.py b/judge/language.py index 841ac7c..7ab6285 100644 --- a/judge/language.py +++ b/judge/language.py @@ -6,6 +6,8 @@ languages = { "name": "c", "src_name": "main.c", "code": 1, + "compile_max_cpu_time": 3000, + "compile_max_memory": 128 * 1024 * 1024, "compile_command": "/usr/bin/gcc -DONLINE_JUDGE -O2 -w -fmax-errors=3 -std=c99 {src_path} -lm -o {exe_path}/main", "spj_compile_command": "/usr/bin/gcc -DONLINE_JUDGE -O2 -Werror -fmax-errors=3 -std=c99 {src_path} -lm -o {exe_path}", "execute_command": "{exe_path}/main", @@ -15,6 +17,8 @@ languages = { "name": "cpp", "src_name": "main.cpp", "code": 2, + "compile_max_cpu_time": 3000, + "compile_max_memory": 128 * 1024 * 1024, "compile_command": "/usr/bin/g++ -DONLINE_JUDGE -O2 -w -fmax-errors=3 -std=c++11 {src_path} -lm -o {exe_path}/main", "spj_compile_command": "/usr/bin/g++ -DONLINE_JUDGE -O2 -Werror -fmax-errors=3 -std=c++11 {src_path} -lm -o {exe_path}", "execute_command": "{exe_path}/main", @@ -24,6 +28,8 @@ languages = { "name": "java", "src_name": "Main.java", "code": 3, + "compile_max_cpu_time": 3000, + "compile_max_memory": 1024 * 1024 * 1024, "compile_command": "/usr/bin/javac {src_path} -d {exe_path} -encoding UTF8", "execute_command": "/usr/bin/java -cp {exe_path} -Xss1M -XX:MaxPermSize=16M " "-XX:PermSize=8M -Xms16M -Xmx{max_memory} -Djava.security.manager "