Cody

# Problem 1287. Unique dice configurations

Solution 2158106

Submitted on 12 Mar 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
assert(isequal(unique_dice(2,6),21))

ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 1 3 6 10 15 21 28 36 45 55 66 78 1 4 10 20 35 56 84 120 165 220 286 364 1 5 15 35 70 126 210 330 495 715 1001 1365 1 6 21 56 126 252 462 792 1287 2002 3003 4368 1 7 28 84 210 462 924 1716 3003 5005 8008 12376 1 8 36 120 330 792 1716 3432 6435 11440 19448 31824 1 9 45 165 495 1287 3003 6435 12870 24310 43758 75582 1 10 55 220 715 2002 5005 11440 24310 48620 92378 167960 1 11 66 286 1001 3003 8008 19448 43758 92378 184756 352716 1 12 78 364 1365 4368 12376 31824 75582 167960 352716 705432

Assertion failed.

2   Fail
assert(isequal(unique_dice(6,8),1716))

ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 1 3 6 10 15 21 28 36 45 55 66 78 1 4 10 20 35 56 84 120 165 220 286 364 1 5 15 35 70 126 210 330 495 715 1001 1365 1 6 21 56 126 252 462 792 1287 2002 3003 4368 1 7 28 84 210 462 924 1716 3003 5005 8008 12376 1 8 36 120 330 792 1716 3432 6435 11440 19448 31824 1 9 45 165 495 1287 3003 6435 12870 24310 43758 75582 1 10 55 220 715 2002 5005 11440 24310 48620 92378 167960 1 11 66 286 1001 3003 8008 19448 43758 92378 184756 352716 1 12 78 364 1365 4368 12376 31824 75582 167960 352716 705432

Assertion failed.

3   Fail
assert(isequal(unique_dice(10,12),352716))

ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 1 3 6 10 15 21 28 36 45 55 66 78 1 4 10 20 35 56 84 120 165 220 286 364 1 5 15 35 70 126 210 330 495 715 1001 1365 1 6 21 56 126 252 462 792 1287 2002 3003 4368 1 7 28 84 210 462 924 1716 3003 5005 8008 12376 1 8 36 120 330 792 1716 3432 6435 11440 19448 31824 1 9 45 165 495 1287 3003 6435 12870 24310 43758 75582 1 10 55 220 715 2002 5005 11440 24310 48620 92378 167960 1 11 66 286 1001 3003 8008 19448 43758 92378 184756 352716 1 12 78 364 1365 4368 12376 31824 75582 167960 352716 705432

Assertion failed.

4   Fail
assert(isequal(unique_dice(20,20),68923264410))

ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 1 3 6 10 15 21 28 36 45 55 66 78 1 4 10 20 35 56 84 120 165 220 286 364 1 5 15 35 70 126 210 330 495 715 1001 1365 1 6 21 56 126 252 462 792 1287 2002 3003 4368 1 7 28 84 210 462 924 1716 3003 5005 8008 12376 1 8 36 120 330 792 1716 3432 6435 11440 19448 31824 1 9 45 165 495 1287 3003 6435 12870 24310 43758 75582 1 10 55 220 715 2002 5005 11440 24310 48620 92378 167960 1 11 66 286 1001 3003 8008 19448 43758 92378 184756 352716 1 12 78 364 1365 4368 12376 31824 75582 167960 352716 705432

Assertion failed.

5   Fail
assert(isequal(unique_dice(4,100),4421275))

ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 1 3 6 10 15 21 28 36 45 55 66 78 1 4 10 20 35 56 84 120 165 220 286 364 1 5 15 35 70 126 210 330 495 715 1001 1365 1 6 21 56 126 252 462 792 1287 2002 3003 4368 1 7 28 84 210 462 924 1716 3003 5005 8008 12376 1 8 36 120 330 792 1716 3432 6435 11440 19448 31824 1 9 45 165 495 1287 3003 6435 12870 24310 43758 75582 1 10 55 220 715 2002 5005 11440 24310 48620 92378 167960 1 11 66 286 1001 3003 8008 19448 43758 92378 184756 352716 1 12 78 364 1365 4368 12376 31824 75582 167960 352716 705432

Assertion failed.

6   Fail
assert(isequal(unique_dice(100,4),176851))

ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 1 3 6 10 15 21 28 36 45 55 66 78 1 4 10 20 35 56 84 120 165 220 286 364 1 5 15 35 70 126 210 330 495 715 1001 1365 1 6 21 56 126 252 462 792 1287 2002 3003 4368 1 7 28 84 210 462 924 1716 3003 5005 8008 12376 1 8 36 120 330 792 1716 3432 6435 11440 19448 31824 1 9 45 165 495 1287 3003 6435 12870 24310 43758 75582 1 10 55 220 715 2002 5005 11440 24310 48620 92378 167960 1 11 66 286 1001 3003 8008 19448 43758 92378 184756 352716 1 12 78 364 1365 4368 12376 31824 75582 167960 352716 705432

Assertion failed.

7   Fail
x=ceil(10000*rand); assert(isequal(unique_dice(1,x),x))

ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 11 12 1 3 6 10 15 21 28 36 45 55 66 78 1 4 10 20 35 56 84 120 165 220 286 364 1 5 15 35 70 126 210 330 495 715 1001 1365 1 6 21 56 126 252 462 792 1287 2002 3003 4368 1 7 28 84 210 462 924 1716 3003 5005 8008 12376 1 8 36 120 330 792 1716 3432 6435 11440 19448 31824 1 9 45 165 495 1287 3003 6435 12870 24310 43758 75582 1 10 55 220 715 2002 5005 11440 24310 48620 92378 167960 1 11 66 286 1001 3003 8008 19448 43758 92378 184756 352716 1 12 78 364 1365 4368 12376 31824 75582 167960 352716 705432

Assertion failed.