From 83338a2f753ebbb7ba7b154cc60b2f427b6121b0 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 26 Mar 2025 19:22:50 +0100 Subject: Added inverse coordinate for CO this is necessary for DR coordinate --- test/079_invcoord_co/00_solved.in | 1 + test/079_invcoord_co/00_solved.out | 1 + test/079_invcoord_co/01_U.in | 1 + test/079_invcoord_co/01_U.out | 1 + test/079_invcoord_co/02_U2.in | 1 + test/079_invcoord_co/02_U2.out | 1 + test/079_invcoord_co/03_U3.in | 1 + test/079_invcoord_co/03_U3.out | 1 + test/079_invcoord_co/04_D.in | 1 + test/079_invcoord_co/04_D.out | 1 + test/079_invcoord_co/07_R.in | 1 + test/079_invcoord_co/07_R.out | 1 + test/079_invcoord_co/08_R2.in | 1 + test/079_invcoord_co/08_R2.out | 1 + test/079_invcoord_co/10_L.in | 1 + test/079_invcoord_co/10_L.out | 1 + test/079_invcoord_co/13_F.in | 1 + test/079_invcoord_co/13_F.out | 1 + test/079_invcoord_co/14_F2.in | 1 + test/079_invcoord_co/14_F2.out | 1 + test/079_invcoord_co/16_B.in | 1 + test/079_invcoord_co/16_B.out | 1 + test/079_invcoord_co/17_B2.in | 1 + test/079_invcoord_co/17_B2.out | 1 + test/079_invcoord_co/20_scrambled.in | 1 + test/079_invcoord_co/20_scrambled.out | 1 + test/079_invcoord_co/invcoord_co_tests.c | 28 ++++++++++++++++++++++++++++ 27 files changed, 54 insertions(+) create mode 100644 test/079_invcoord_co/00_solved.in create mode 100644 test/079_invcoord_co/00_solved.out create mode 100644 test/079_invcoord_co/01_U.in create mode 100644 test/079_invcoord_co/01_U.out create mode 100644 test/079_invcoord_co/02_U2.in create mode 100644 test/079_invcoord_co/02_U2.out create mode 100644 test/079_invcoord_co/03_U3.in create mode 100644 test/079_invcoord_co/03_U3.out create mode 100644 test/079_invcoord_co/04_D.in create mode 100644 test/079_invcoord_co/04_D.out create mode 100644 test/079_invcoord_co/07_R.in create mode 100644 test/079_invcoord_co/07_R.out create mode 100644 test/079_invcoord_co/08_R2.in create mode 100644 test/079_invcoord_co/08_R2.out create mode 100644 test/079_invcoord_co/10_L.in create mode 100644 test/079_invcoord_co/10_L.out create mode 100644 test/079_invcoord_co/13_F.in create mode 100644 test/079_invcoord_co/13_F.out create mode 100644 test/079_invcoord_co/14_F2.in create mode 100644 test/079_invcoord_co/14_F2.out create mode 100644 test/079_invcoord_co/16_B.in create mode 100644 test/079_invcoord_co/16_B.out create mode 100644 test/079_invcoord_co/17_B2.in create mode 100644 test/079_invcoord_co/17_B2.out create mode 100644 test/079_invcoord_co/20_scrambled.in create mode 100644 test/079_invcoord_co/20_scrambled.out create mode 100644 test/079_invcoord_co/invcoord_co_tests.c (limited to 'test') diff --git a/test/079_invcoord_co/00_solved.in b/test/079_invcoord_co/00_solved.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/00_solved.in @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/00_solved.out b/test/079_invcoord_co/00_solved.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/00_solved.out @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/01_U.in b/test/079_invcoord_co/01_U.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/01_U.in @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/01_U.out b/test/079_invcoord_co/01_U.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/01_U.out @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/02_U2.in b/test/079_invcoord_co/02_U2.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/02_U2.in @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/02_U2.out b/test/079_invcoord_co/02_U2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/02_U2.out @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/03_U3.in b/test/079_invcoord_co/03_U3.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/03_U3.in @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/03_U3.out b/test/079_invcoord_co/03_U3.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/03_U3.out @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/04_D.in b/test/079_invcoord_co/04_D.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/04_D.in @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/04_D.out b/test/079_invcoord_co/04_D.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/04_D.out @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/07_R.in b/test/079_invcoord_co/07_R.in new file mode 100644 index 0000000..1f3d8a7 --- /dev/null +++ b/test/079_invcoord_co/07_R.in @@ -0,0 +1 @@ +1028 diff --git a/test/079_invcoord_co/07_R.out b/test/079_invcoord_co/07_R.out new file mode 100644 index 0000000..1f3d8a7 --- /dev/null +++ b/test/079_invcoord_co/07_R.out @@ -0,0 +1 @@ +1028 diff --git a/test/079_invcoord_co/08_R2.in b/test/079_invcoord_co/08_R2.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/08_R2.in @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/08_R2.out b/test/079_invcoord_co/08_R2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/08_R2.out @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/10_L.in b/test/079_invcoord_co/10_L.in new file mode 100644 index 0000000..f96ac06 --- /dev/null +++ b/test/079_invcoord_co/10_L.in @@ -0,0 +1 @@ +105 diff --git a/test/079_invcoord_co/10_L.out b/test/079_invcoord_co/10_L.out new file mode 100644 index 0000000..f96ac06 --- /dev/null +++ b/test/079_invcoord_co/10_L.out @@ -0,0 +1 @@ +105 diff --git a/test/079_invcoord_co/13_F.in b/test/079_invcoord_co/13_F.in new file mode 100644 index 0000000..86868c5 --- /dev/null +++ b/test/079_invcoord_co/13_F.in @@ -0,0 +1 @@ +1630 diff --git a/test/079_invcoord_co/13_F.out b/test/079_invcoord_co/13_F.out new file mode 100644 index 0000000..86868c5 --- /dev/null +++ b/test/079_invcoord_co/13_F.out @@ -0,0 +1 @@ +1630 diff --git a/test/079_invcoord_co/14_F2.in b/test/079_invcoord_co/14_F2.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/14_F2.in @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/14_F2.out b/test/079_invcoord_co/14_F2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/14_F2.out @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/16_B.in b/test/079_invcoord_co/16_B.in new file mode 100644 index 0000000..1c599d4 --- /dev/null +++ b/test/079_invcoord_co/16_B.in @@ -0,0 +1 @@ +516 diff --git a/test/079_invcoord_co/16_B.out b/test/079_invcoord_co/16_B.out new file mode 100644 index 0000000..1c599d4 --- /dev/null +++ b/test/079_invcoord_co/16_B.out @@ -0,0 +1 @@ +516 diff --git a/test/079_invcoord_co/17_B2.in b/test/079_invcoord_co/17_B2.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/17_B2.in @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/17_B2.out b/test/079_invcoord_co/17_B2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/079_invcoord_co/17_B2.out @@ -0,0 +1 @@ +0 diff --git a/test/079_invcoord_co/20_scrambled.in b/test/079_invcoord_co/20_scrambled.in new file mode 100644 index 0000000..6943e4d --- /dev/null +++ b/test/079_invcoord_co/20_scrambled.in @@ -0,0 +1 @@ +957 diff --git a/test/079_invcoord_co/20_scrambled.out b/test/079_invcoord_co/20_scrambled.out new file mode 100644 index 0000000..6943e4d --- /dev/null +++ b/test/079_invcoord_co/20_scrambled.out @@ -0,0 +1 @@ +957 diff --git a/test/079_invcoord_co/invcoord_co_tests.c b/test/079_invcoord_co/invcoord_co_tests.c new file mode 100644 index 0000000..c3bf90e --- /dev/null +++ b/test/079_invcoord_co/invcoord_co_tests.c @@ -0,0 +1,28 @@ +#include "../test.h" + +int64_t coord_co(cube_t); +cube_t invcoord_co(int64_t); + +void run(void) { + char str[STRLENMAX]; + cube_t cube; + int64_t coord; + + fgets(str, STRLENMAX, stdin); + coord = atoll(str); + + cube = invcoord_co(coord); + + if (!isconsistent(cube)) { + printf("Not consistent\n"); + return; + } + if (!issolvable(cube)) { + printf("Not solvable\n"); + return; + } + + coord = coord_co(cube); + + printf("%" PRId64 "\n", coord); +} -- cgit v1.3