aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-04 17:09:55 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-04 17:09:55 +0200
commit518d98ad5f9eec0cf4124375bdbb84d1296b3f3f (patch)
tree467b2b0387f23a0b379cf428c6883937ec18c134 /test
parent425eee24421bf0a19c7e0199d2e3ecba3318c8f4 (diff)
downloadnissy-core-518d98ad5f9eec0cf4124375bdbb84d1296b3f3f.tar.gz
nissy-core-518d98ad5f9eec0cf4124375bdbb84d1296b3f3f.zip
(almost) added getcube
Diffstat (limited to 'test')
-rw-r--r--test/010_math_permtoindex/00_noperm.in4
-rw-r--r--test/010_math_permtoindex/00_noperm.out1
-rw-r--r--test/010_math_permtoindex/01_toobig.in16
-rw-r--r--test/010_math_permtoindex/01_toobig.out1
-rw-r--r--test/010_math_permtoindex/02_offrange.in4
-rw-r--r--test/010_math_permtoindex/02_offrange.out1
-rw-r--r--test/010_math_permtoindex/03_2_solved.in3
-rw-r--r--test/010_math_permtoindex/03_2_solved.out (renamed from test/010_math_permsign/00_solved.out)0
-rw-r--r--test/010_math_permtoindex/04_2_swapped.in3
-rw-r--r--test/010_math_permtoindex/04_2_swapped.out (renamed from test/010_math_permsign/03_singleswap.out)0
-rw-r--r--test/010_math_permtoindex/05_7_solved.in (renamed from test/010_math_permsign/00_solved.in)0
-rw-r--r--test/010_math_permtoindex/05_7_solved.out (renamed from test/010_math_permsign/01_3cycle.out)0
-rw-r--r--test/010_math_permtoindex/06_7_reversed.in8
-rw-r--r--test/010_math_permtoindex/06_7_reversed.out1
-rw-r--r--test/010_math_permtoindex/07_4_random.in5
-rw-r--r--test/010_math_permtoindex/07_4_random.out1
-rw-r--r--test/010_math_permtoindex/permtoindex_tests.c19
-rw-r--r--test/011_math_indextoperm/00_noperm.in2
-rw-r--r--test/011_math_indextoperm/00_noperm.out3
-rw-r--r--test/011_math_indextoperm/01_toobig.in2
-rw-r--r--test/011_math_indextoperm/01_toobig.out15
-rw-r--r--test/011_math_indextoperm/02_offrange.in2
-rw-r--r--test/011_math_indextoperm/02_offrange.out3
-rw-r--r--test/011_math_indextoperm/03_2_solved.in2
-rw-r--r--test/011_math_indextoperm/03_2_solved.out2
-rw-r--r--test/011_math_indextoperm/04_2_swapped.in2
-rw-r--r--test/011_math_indextoperm/04_2_swapped.out2
-rw-r--r--test/011_math_indextoperm/05_7_solved.in2
-rw-r--r--test/011_math_indextoperm/05_7_solved.out7
-rw-r--r--test/011_math_indextoperm/06_7_reversed.in2
-rw-r--r--test/011_math_indextoperm/06_7_reversed.out7
-rw-r--r--test/011_math_indextoperm/07_4_random.in2
-rw-r--r--test/011_math_indextoperm/07_4_random.out4
-rw-r--r--test/011_math_indextoperm/indextoperm_tests.c19
-rw-r--r--test/012_math_permsign/00_solved.in8
-rw-r--r--test/012_math_permsign/00_solved.out (renamed from test/010_math_permsign/02_22swap.out)0
-rw-r--r--test/012_math_permsign/01_3cycle.in (renamed from test/010_math_permsign/01_3cycle.in)0
-rw-r--r--test/012_math_permsign/01_3cycle.out (renamed from test/010_math_permsign/04_5ycle.out)0
-rw-r--r--test/012_math_permsign/02_22swap.in (renamed from test/010_math_permsign/02_22swap.in)0
-rw-r--r--test/012_math_permsign/02_22swap.out1
-rw-r--r--test/012_math_permsign/03_singleswap.in (renamed from test/010_math_permsign/03_singleswap.in)0
-rw-r--r--test/012_math_permsign/03_singleswap.out (renamed from test/010_math_permsign/05_6ycle.out)0
-rw-r--r--test/012_math_permsign/04_5ycle.in (renamed from test/010_math_permsign/04_5ycle.in)0
-rw-r--r--test/012_math_permsign/04_5ycle.out1
-rw-r--r--test/012_math_permsign/05_6ycle.in (renamed from test/010_math_permsign/05_6ycle.in)0
-rw-r--r--test/012_math_permsign/05_6ycle.out1
-rw-r--r--test/012_math_permsign/permsign_tests.c (renamed from test/010_math_permsign/permsgn_tests.c)7
47 files changed, 160 insertions, 3 deletions
diff --git a/test/010_math_permtoindex/00_noperm.in b/test/010_math_permtoindex/00_noperm.in
new file mode 100644
index 0000000..f838f21
--- /dev/null
+++ b/test/010_math_permtoindex/00_noperm.in
@@ -0,0 +1,4 @@
13
20
31
41
diff --git a/test/010_math_permtoindex/00_noperm.out b/test/010_math_permtoindex/00_noperm.out
new file mode 100644
index 0000000..3a2e3f4
--- /dev/null
+++ b/test/010_math_permtoindex/00_noperm.out
@@ -0,0 +1 @@
-1
diff --git a/test/010_math_permtoindex/01_toobig.in b/test/010_math_permtoindex/01_toobig.in
new file mode 100644
index 0000000..a0fb28c
--- /dev/null
+++ b/test/010_math_permtoindex/01_toobig.in
@@ -0,0 +1,16 @@
115
20
31
42
53
64
75
86
97
108
119
1210
1311
1412
1513
1614
diff --git a/test/010_math_permtoindex/01_toobig.out b/test/010_math_permtoindex/01_toobig.out
new file mode 100644
index 0000000..3a2e3f4
--- /dev/null
+++ b/test/010_math_permtoindex/01_toobig.out
@@ -0,0 +1 @@
-1
diff --git a/test/010_math_permtoindex/02_offrange.in b/test/010_math_permtoindex/02_offrange.in
new file mode 100644
index 0000000..66ec716
--- /dev/null
+++ b/test/010_math_permtoindex/02_offrange.in
@@ -0,0 +1,4 @@
13
20
34
41
diff --git a/test/010_math_permtoindex/02_offrange.out b/test/010_math_permtoindex/02_offrange.out
new file mode 100644
index 0000000..3a2e3f4
--- /dev/null
+++ b/test/010_math_permtoindex/02_offrange.out
@@ -0,0 +1 @@
-1
diff --git a/test/010_math_permtoindex/03_2_solved.in b/test/010_math_permtoindex/03_2_solved.in
new file mode 100644
index 0000000..4c5d59c
--- /dev/null
+++ b/test/010_math_permtoindex/03_2_solved.in
@@ -0,0 +1,3 @@
12
20
31
diff --git a/test/010_math_permsign/00_solved.out b/test/010_math_permtoindex/03_2_solved.out
index 573541a..573541a 100644
--- a/test/010_math_permsign/00_solved.out
+++ b/test/010_math_permtoindex/03_2_solved.out
diff --git a/test/010_math_permtoindex/04_2_swapped.in b/test/010_math_permtoindex/04_2_swapped.in
new file mode 100644
index 0000000..ae13693
--- /dev/null
+++ b/test/010_math_permtoindex/04_2_swapped.in
@@ -0,0 +1,3 @@
12
21
30
diff --git a/test/010_math_permsign/03_singleswap.out b/test/010_math_permtoindex/04_2_swapped.out
index d00491f..d00491f 100644
--- a/test/010_math_permsign/03_singleswap.out
+++ b/test/010_math_permtoindex/04_2_swapped.out
diff --git a/test/010_math_permsign/00_solved.in b/test/010_math_permtoindex/05_7_solved.in
index 54b5db0..54b5db0 100644
--- a/test/010_math_permsign/00_solved.in
+++ b/test/010_math_permtoindex/05_7_solved.in
diff --git a/test/010_math_permsign/01_3cycle.out b/test/010_math_permtoindex/05_7_solved.out
index 573541a..573541a 100644
--- a/test/010_math_permsign/01_3cycle.out
+++ b/test/010_math_permtoindex/05_7_solved.out
diff --git a/test/010_math_permtoindex/06_7_reversed.in b/test/010_math_permtoindex/06_7_reversed.in
new file mode 100644
index 0000000..ed11605
--- /dev/null
+++ b/test/010_math_permtoindex/06_7_reversed.in
@@ -0,0 +1,8 @@
17
26
35
44
53
62
71
80
diff --git a/test/010_math_permtoindex/06_7_reversed.out b/test/010_math_permtoindex/06_7_reversed.out
new file mode 100644
index 0000000..ad2ea70
--- /dev/null
+++ b/test/010_math_permtoindex/06_7_reversed.out
@@ -0,0 +1 @@
5039
diff --git a/test/010_math_permtoindex/07_4_random.in b/test/010_math_permtoindex/07_4_random.in
new file mode 100644
index 0000000..614bc61
--- /dev/null
+++ b/test/010_math_permtoindex/07_4_random.in
@@ -0,0 +1,5 @@
14
20
32
43
51
diff --git a/test/010_math_permtoindex/07_4_random.out b/test/010_math_permtoindex/07_4_random.out
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/test/010_math_permtoindex/07_4_random.out
@@ -0,0 +1 @@
3
diff --git a/test/010_math_permtoindex/permtoindex_tests.c b/test/010_math_permtoindex/permtoindex_tests.c
new file mode 100644
index 0000000..98c8207
--- /dev/null
+++ b/test/010_math_permtoindex/permtoindex_tests.c
@@ -0,0 +1,19 @@
1#include "../test.h"
2
3int64_t permtoindex(uint8_t *, int64_t);
4
5void run(void) {
6 char str[STRLENMAX];
7 uint8_t a[100];
8 int64_t n, i, p;
9
10 fgets(str, STRLENMAX, stdin);
11 n = atoll(str);
12 for (i = 0; i < n; i++) {
13 fgets(str, STRLENMAX, stdin);
14 a[i] = atoi(str);
15 }
16
17 p = permtoindex(a, n);
18 printf("%" PRId64 "\n", p);
19}
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 @@
13
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 @@
1255
2255
3255
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 @@
115
20
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 @@
1255
2255
3255
4255
5255
6255
7255
8255
9255
10255
11255
12255
13255
14255
15255
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 @@
13
210
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 @@
1255
2255
3255
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 @@
12
20
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 @@
10
21
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 @@
12
21
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 @@
11
20
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 @@
17
20
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 @@
10
21
32
43
54
65
76
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 @@
17
25039
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 @@
16
25
34
43
52
61
70
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 @@
14
23
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 @@
10
22
33
41
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
3void indextoperm(int64_t, int64_t, uint8_t *);
4
5void 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}
diff --git a/test/012_math_permsign/00_solved.in b/test/012_math_permsign/00_solved.in
new file mode 100644
index 0000000..54b5db0
--- /dev/null
+++ b/test/012_math_permsign/00_solved.in
@@ -0,0 +1,8 @@
17
20
31
42
53
64
75
86
diff --git a/test/010_math_permsign/02_22swap.out b/test/012_math_permsign/00_solved.out
index 573541a..573541a 100644
--- a/test/010_math_permsign/02_22swap.out
+++ b/test/012_math_permsign/00_solved.out
diff --git a/test/010_math_permsign/01_3cycle.in b/test/012_math_permsign/01_3cycle.in
index bfabfd6..bfabfd6 100644
--- a/test/010_math_permsign/01_3cycle.in
+++ b/test/012_math_permsign/01_3cycle.in
diff --git a/test/010_math_permsign/04_5ycle.out b/test/012_math_permsign/01_3cycle.out
index 573541a..573541a 100644
--- a/test/010_math_permsign/04_5ycle.out
+++ b/test/012_math_permsign/01_3cycle.out
diff --git a/test/010_math_permsign/02_22swap.in b/test/012_math_permsign/02_22swap.in
index d0b0921..d0b0921 100644
--- a/test/010_math_permsign/02_22swap.in
+++ b/test/012_math_permsign/02_22swap.in
diff --git a/test/012_math_permsign/02_22swap.out b/test/012_math_permsign/02_22swap.out
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/test/012_math_permsign/02_22swap.out
@@ -0,0 +1 @@
0
diff --git a/test/010_math_permsign/03_singleswap.in b/test/012_math_permsign/03_singleswap.in
index 42a584b..42a584b 100644
--- a/test/010_math_permsign/03_singleswap.in
+++ b/test/012_math_permsign/03_singleswap.in
diff --git a/test/010_math_permsign/05_6ycle.out b/test/012_math_permsign/03_singleswap.out
index d00491f..d00491f 100644
--- a/test/010_math_permsign/05_6ycle.out
+++ b/test/012_math_permsign/03_singleswap.out
diff --git a/test/010_math_permsign/04_5ycle.in b/test/012_math_permsign/04_5ycle.in
index 630f6fa..630f6fa 100644
--- a/test/010_math_permsign/04_5ycle.in
+++ b/test/012_math_permsign/04_5ycle.in
diff --git a/test/012_math_permsign/04_5ycle.out b/test/012_math_permsign/04_5ycle.out
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/test/012_math_permsign/04_5ycle.out
@@ -0,0 +1 @@
0
diff --git a/test/010_math_permsign/05_6ycle.in b/test/012_math_permsign/05_6ycle.in
index a226bae..a226bae 100644
--- a/test/010_math_permsign/05_6ycle.in
+++ b/test/012_math_permsign/05_6ycle.in
diff --git a/test/012_math_permsign/05_6ycle.out b/test/012_math_permsign/05_6ycle.out
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/012_math_permsign/05_6ycle.out
@@ -0,0 +1 @@
1
diff --git a/test/010_math_permsign/permsgn_tests.c b/test/012_math_permsign/permsign_tests.c
index 04975db..fa8ce9b 100644
--- a/test/010_math_permsign/permsgn_tests.c
+++ b/test/012_math_permsign/permsign_tests.c
@@ -1,14 +1,15 @@
1#include "../test.h" 1#include "../test.h"
2 2
3int permsign(uint8_t *, int); 3int permsign(uint8_t *, int64_t);
4 4
5void run(void) { 5void run(void) {
6 char str[STRLENMAX]; 6 char str[STRLENMAX];
7 uint8_t a[100]; 7 uint8_t a[100];
8 int n, i, p; 8 int p;
9 int64_t n, i;
9 10
10 fgets(str, STRLENMAX, stdin); 11 fgets(str, STRLENMAX, stdin);
11 n = atoi(str); 12 n = atoll(str);
12 13
13 for (i = 0; i < n; i++) { 14 for (i = 0; i < n; i++) {
14 fgets(str, STRLENMAX, stdin); 15 fgets(str, STRLENMAX, stdin);

Generated with cgit - Back to sebastiano.tronto.net