From: Martin Mares Date: Sat, 15 Aug 2009 01:08:46 +0000 (+0200) Subject: Saved the example task X-Git-Tag: python-dummy-working~66 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=15ce71b1babe95534a9aae3a5ef5eb80a7dbaa0d;p=moe.git Saved the example task --- diff --git a/t/problems/sum/1.config b/t/problems/sum/1.config new file mode 100644 index 0000000..ce36b74 --- /dev/null +++ b/t/problems/sum/1.config @@ -0,0 +1 @@ +POINTS_PER_TEST=2 diff --git a/t/problems/sum/1.in b/t/problems/sum/1.in new file mode 100644 index 0000000..b85905e --- /dev/null +++ b/t/problems/sum/1.in @@ -0,0 +1 @@ +1 2 3 diff --git a/t/problems/sum/1.out b/t/problems/sum/1.out new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/t/problems/sum/1.out @@ -0,0 +1 @@ +6 diff --git a/t/problems/sum/2.in b/t/problems/sum/2.in new file mode 100644 index 0000000..aacb595 --- /dev/null +++ b/t/problems/sum/2.in @@ -0,0 +1 @@ +1 2 3 4 5 diff --git a/t/problems/sum/2.out b/t/problems/sum/2.out new file mode 100644 index 0000000..60d3b2f --- /dev/null +++ b/t/problems/sum/2.out @@ -0,0 +1 @@ +15 diff --git a/t/problems/sum/config b/t/problems/sum/config new file mode 100644 index 0000000..9c29ccb --- /dev/null +++ b/t/problems/sum/config @@ -0,0 +1,33 @@ +# Per-task config +# All variables can be overriden in test-specific .config + +# A list of all tests +TESTS=1 +TESTS+=2 3 + +# Test with example input +SAMPLE_TESTS=1 + +# Number of points per test +POINTS_PER_TEST=1 + +# List of extra files needed for compilation +EXTRAS="extras.h" + +# Time limit in seconds +TIME_LIMIT=10 + +# Memory limit in kilobytes +MEM_LIMIT=16384 + +# Command used to check output syntax (optional) +SYNTAX_CHECK=grep -v -- - $TDIR/$TEST.out >/dev/null + +# Command used to check output correctness +OUTPUT_CHECK=diff -bBu $TDIR/$TEST.ok $TDIR/$TEST.out && echo >$TDIR/$TEST.pts 22 + +OUTPUT_FILTER=tr -d '\r' <$TDIR/$TEST.raw >$TDIR/$TEST.out + +TEST_1_EXT_c_TIME_LIMIT=9.9 + +IO_TYPE=file diff --git a/t/problems/sum/extras.h b/t/problems/sum/extras.h new file mode 100644 index 0000000..b3ff325 --- /dev/null +++ b/t/problems/sum/extras.h @@ -0,0 +1 @@ +/* Dummy header we're testing */ diff --git a/t/solutions/mj/sum/sum.c b/t/solutions/mj/sum/sum.c new file mode 100644 index 0000000..a91e54c --- /dev/null +++ b/t/solutions/mj/sum/sum.c @@ -0,0 +1,14 @@ +#include + +int main(void) +{ + int x; + int sum = 0; + FILE *fi = fopen("sum.in", "r"); + FILE *fo = fopen("sum.out", "w"); + + while (fscanf(fi, "%d", &x) == 1) + sum += x; + fprintf(fo, "%d\n", sum); + return 0; +}