diff options
Diffstat (limited to 'test/011_math_indextoperm')
| -rw-r--r-- | test/011_math_indextoperm/00_noperm.in | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/00_noperm.out | 3 | ||||
| -rw-r--r-- | test/011_math_indextoperm/01_toobig.in | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/01_toobig.out | 15 | ||||
| -rw-r--r-- | test/011_math_indextoperm/02_offrange.in | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/02_offrange.out | 3 | ||||
| -rw-r--r-- | test/011_math_indextoperm/03_2_solved.in | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/03_2_solved.out | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/04_2_swapped.in | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/04_2_swapped.out | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/05_7_solved.in | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/05_7_solved.out | 7 | ||||
| -rw-r--r-- | test/011_math_indextoperm/06_7_reversed.in | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/06_7_reversed.out | 7 | ||||
| -rw-r--r-- | test/011_math_indextoperm/07_4_random.in | 2 | ||||
| -rw-r--r-- | test/011_math_indextoperm/07_4_random.out | 4 | ||||
| -rw-r--r-- | test/011_math_indextoperm/indextoperm_tests.c | 19 |
17 files changed, 78 insertions, 0 deletions
diff --git a/test/011_math_indextoperm/00_noperm.in b/test/011_math_indextoperm/00_noperm.in new file mode 100644 index 0000000..81d7aba --- /dev/null +++ b/test/011_math_indextoperm/00_noperm.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 3 | ||
| 2 | -1 | ||
diff --git a/test/011_math_indextoperm/00_noperm.out b/test/011_math_indextoperm/00_noperm.out new file mode 100644 index 0000000..c656952 --- /dev/null +++ b/test/011_math_indextoperm/00_noperm.out | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | 255 | ||
| 2 | 255 | ||
| 3 | 255 | ||
diff --git a/test/011_math_indextoperm/01_toobig.in b/test/011_math_indextoperm/01_toobig.in new file mode 100644 index 0000000..227eae2 --- /dev/null +++ b/test/011_math_indextoperm/01_toobig.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 15 | ||
| 2 | 0 | ||
diff --git a/test/011_math_indextoperm/01_toobig.out b/test/011_math_indextoperm/01_toobig.out new file mode 100644 index 0000000..a4cc325 --- /dev/null +++ b/test/011_math_indextoperm/01_toobig.out | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | 255 | ||
| 2 | 255 | ||
| 3 | 255 | ||
| 4 | 255 | ||
| 5 | 255 | ||
| 6 | 255 | ||
| 7 | 255 | ||
| 8 | 255 | ||
| 9 | 255 | ||
| 10 | 255 | ||
| 11 | 255 | ||
| 12 | 255 | ||
| 13 | 255 | ||
| 14 | 255 | ||
| 15 | 255 | ||
diff --git a/test/011_math_indextoperm/02_offrange.in b/test/011_math_indextoperm/02_offrange.in new file mode 100644 index 0000000..47b5fdd --- /dev/null +++ b/test/011_math_indextoperm/02_offrange.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 3 | ||
| 2 | 10 | ||
diff --git a/test/011_math_indextoperm/02_offrange.out b/test/011_math_indextoperm/02_offrange.out new file mode 100644 index 0000000..c656952 --- /dev/null +++ b/test/011_math_indextoperm/02_offrange.out | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | 255 | ||
| 2 | 255 | ||
| 3 | 255 | ||
diff --git a/test/011_math_indextoperm/03_2_solved.in b/test/011_math_indextoperm/03_2_solved.in new file mode 100644 index 0000000..389e262 --- /dev/null +++ b/test/011_math_indextoperm/03_2_solved.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 2 | ||
| 2 | 0 | ||
diff --git a/test/011_math_indextoperm/03_2_solved.out b/test/011_math_indextoperm/03_2_solved.out new file mode 100644 index 0000000..0d66ea1 --- /dev/null +++ b/test/011_math_indextoperm/03_2_solved.out | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 0 | ||
| 2 | 1 | ||
diff --git a/test/011_math_indextoperm/04_2_swapped.in b/test/011_math_indextoperm/04_2_swapped.in new file mode 100644 index 0000000..5f1d0ec --- /dev/null +++ b/test/011_math_indextoperm/04_2_swapped.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 2 | ||
| 2 | 1 | ||
diff --git a/test/011_math_indextoperm/04_2_swapped.out b/test/011_math_indextoperm/04_2_swapped.out new file mode 100644 index 0000000..b261da1 --- /dev/null +++ b/test/011_math_indextoperm/04_2_swapped.out | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 1 | ||
| 2 | 0 | ||
diff --git a/test/011_math_indextoperm/05_7_solved.in b/test/011_math_indextoperm/05_7_solved.in new file mode 100644 index 0000000..a8148db --- /dev/null +++ b/test/011_math_indextoperm/05_7_solved.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 7 | ||
| 2 | 0 | ||
diff --git a/test/011_math_indextoperm/05_7_solved.out b/test/011_math_indextoperm/05_7_solved.out new file mode 100644 index 0000000..09c277a --- /dev/null +++ b/test/011_math_indextoperm/05_7_solved.out | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | 0 | ||
| 2 | 1 | ||
| 3 | 2 | ||
| 4 | 3 | ||
| 5 | 4 | ||
| 6 | 5 | ||
| 7 | 6 | ||
diff --git a/test/011_math_indextoperm/06_7_reversed.in b/test/011_math_indextoperm/06_7_reversed.in new file mode 100644 index 0000000..a09bc61 --- /dev/null +++ b/test/011_math_indextoperm/06_7_reversed.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 7 | ||
| 2 | 5039 | ||
diff --git a/test/011_math_indextoperm/06_7_reversed.out b/test/011_math_indextoperm/06_7_reversed.out new file mode 100644 index 0000000..61d1e47 --- /dev/null +++ b/test/011_math_indextoperm/06_7_reversed.out | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | 6 | ||
| 2 | 5 | ||
| 3 | 4 | ||
| 4 | 3 | ||
| 5 | 2 | ||
| 6 | 1 | ||
| 7 | 0 | ||
diff --git a/test/011_math_indextoperm/07_4_random.in b/test/011_math_indextoperm/07_4_random.in new file mode 100644 index 0000000..81450f3 --- /dev/null +++ b/test/011_math_indextoperm/07_4_random.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 4 | ||
| 2 | 3 | ||
diff --git a/test/011_math_indextoperm/07_4_random.out b/test/011_math_indextoperm/07_4_random.out new file mode 100644 index 0000000..2696809 --- /dev/null +++ b/test/011_math_indextoperm/07_4_random.out | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | 0 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 1 | ||
diff --git a/test/011_math_indextoperm/indextoperm_tests.c b/test/011_math_indextoperm/indextoperm_tests.c new file mode 100644 index 0000000..cb1306d --- /dev/null +++ b/test/011_math_indextoperm/indextoperm_tests.c | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | void indextoperm(int64_t, int64_t, uint8_t *); | ||
| 4 | |||
| 5 | void run(void) { | ||
| 6 | char str[STRLENMAX]; | ||
| 7 | uint8_t a[100]; | ||
| 8 | int64_t n, p, i; | ||
| 9 | |||
| 10 | fgets(str, STRLENMAX, stdin); | ||
| 11 | n = atoll(str); | ||
| 12 | fgets(str, STRLENMAX, stdin); | ||
| 13 | p = atoll(str); | ||
| 14 | |||
| 15 | indextoperm(p, n, a); | ||
| 16 | |||
| 17 | for (i = 0; i < n; i++) | ||
| 18 | printf("%" PRIu8 "\n", a[i]); | ||
| 19 | } | ||
