28 lines
1.2 KiB
Makefile
28 lines
1.2 KiB
Makefile
include ${TEMPLATE}/c.mk ${TEMPLATE}/Judger.mk
|
||
|
||
# 当题目被下载到 runner 后,会自动执行 prebuild 阶段,判题时不会再次执行
|
||
|
||
# prebuild 阶段环境信息
|
||
# 目录映射情况:
|
||
# /woj/problem
|
||
# ├── data 映射到题目目录的 ./data
|
||
# └── judge 映射到题目目录的 ./judge
|
||
# 环境变量:
|
||
# PREFIX=/woj
|
||
# 其余通用环境变量,详见 nsjail.go
|
||
# 执行限制:
|
||
# 目前版本硬编码限制:时间 300s,内存 1g
|
||
|
||
prebuild:
|
||
# 生成测试数据生成工具
|
||
clang++ -I$(TESTLIB) -Ofast -o $(PREFIX)/problem/judge/gen.out $(PREFIX)/problem/judge/gen.cpp
|
||
# 生成 2,4 号测试数据
|
||
@if [ ! -f $(PREFIX)/problem/data/input/2.input ]; then \
|
||
$(PREFIX)/problem/judge/gen.out > $(PREFIX)/problem/data/input/2.input; \
|
||
python3 -c "print(sum(map(int, input().split())))" < $(PREFIX)/problem/data/input/2.input > $(PREFIX)/problem/data/output/2.output; \
|
||
fi
|
||
@if [ ! -f $(PREFIX)/problem/data/input/4.input ]; then \
|
||
$(PREFIX)/problem/judge/gen.out > $(PREFIX)/problem/data/input/4.input; \
|
||
python3 -c "print(sum(map(int, input().split())))" < $(PREFIX)/problem/data/input/4.input > $(PREFIX)/problem/data/output/4.output; \
|
||
fi
|