From dd9dd49b02e538ef3a2e3f1bd1d70a5d428a526d Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 20 May 2021 22:59:50 +0800 Subject: [PATCH] add more testdata examples --- examples/{ => reverse_proxy}/h2o.conf | 0 examples/{ => reverse_proxy}/nginx.conf | 0 examples/testdata/A+B Problem/aplusb1.in | 1 + examples/testdata/A+B Problem/aplusb1.out | 1 + examples/testdata/Special Judge/a1.in | 1 + examples/testdata/Special Judge/a1.out | 1 + examples/testdata/Special Judge/chk.cc | 14 ++++++++++++++ examples/testdata/Special Judge/config.yaml | 3 +++ 8 files changed, 21 insertions(+) rename examples/{ => reverse_proxy}/h2o.conf (100%) rename examples/{ => reverse_proxy}/nginx.conf (100%) create mode 100644 examples/testdata/A+B Problem/aplusb1.in create mode 100644 examples/testdata/A+B Problem/aplusb1.out create mode 100644 examples/testdata/Special Judge/a1.in create mode 100644 examples/testdata/Special Judge/a1.out create mode 100644 examples/testdata/Special Judge/chk.cc create mode 100644 examples/testdata/Special Judge/config.yaml diff --git a/examples/h2o.conf b/examples/reverse_proxy/h2o.conf similarity index 100% rename from examples/h2o.conf rename to examples/reverse_proxy/h2o.conf diff --git a/examples/nginx.conf b/examples/reverse_proxy/nginx.conf similarity index 100% rename from examples/nginx.conf rename to examples/reverse_proxy/nginx.conf diff --git a/examples/testdata/A+B Problem/aplusb1.in b/examples/testdata/A+B Problem/aplusb1.in new file mode 100644 index 00000000..8d04f961 --- /dev/null +++ b/examples/testdata/A+B Problem/aplusb1.in @@ -0,0 +1 @@ +1 2 diff --git a/examples/testdata/A+B Problem/aplusb1.out b/examples/testdata/A+B Problem/aplusb1.out new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/examples/testdata/A+B Problem/aplusb1.out @@ -0,0 +1 @@ +3 diff --git a/examples/testdata/Special Judge/a1.in b/examples/testdata/Special Judge/a1.in new file mode 100644 index 00000000..8d04f961 --- /dev/null +++ b/examples/testdata/Special Judge/a1.in @@ -0,0 +1 @@ +1 2 diff --git a/examples/testdata/Special Judge/a1.out b/examples/testdata/Special Judge/a1.out new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/examples/testdata/Special Judge/a1.out @@ -0,0 +1 @@ +3 diff --git a/examples/testdata/Special Judge/chk.cc b/examples/testdata/Special Judge/chk.cc new file mode 100644 index 00000000..50d00894 --- /dev/null +++ b/examples/testdata/Special Judge/chk.cc @@ -0,0 +1,14 @@ +#include "testlib.h" +#include + +int main(int argc, char *argv[]) { + /* + * inf:输入 + * ouf:选手输出 + * ans:标准输出 + */ + registerTestlibCmd(argc, argv); + double pans = ouf.readDouble(), jans = ans.readDouble(); + if (pans == jans) quitf(_ok, "Good job\n"); + else quitf(_wa, "Too big or too small, expected %f, found %f\n", jans, pans); +} diff --git a/examples/testdata/Special Judge/config.yaml b/examples/testdata/Special Judge/config.yaml new file mode 100644 index 00000000..3f13342d --- /dev/null +++ b/examples/testdata/Special Judge/config.yaml @@ -0,0 +1,3 @@ +type: default +checker_type: testlib +checker: chk.cc \ No newline at end of file