Cody

# Problem 1959. German tank problem

Solution 1922897

Submitted on 5 Sep 2019
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
Ntest=1e4; N=randi([10,100],Ntest,1); K=randi([1 10],Ntest,1); M=arrayfun(@(N,K)max(randi(N,1,K)),N,K); N_hat=arrayfun(@tank_problem,K,M); rate=mean(N==N_hat); assert(rate>=.1,sprintf('hit rate too low (%0.2f%%)',rate*100)); fprintf('hit rate = %0.2f%%\n',rate*100);

N = 47 k = 2 N = 35 k = 4 N = 25 k = 1 N = 21 k = 1 N = 47 k = 6 N = 95 k = 2 N = 21 k = 5 N = 15 k = 8 N = 53 k = 1 N = 93 k = 10 N = 35 k = 1 N = 22 k = 7 N = 87 k = 8 N = 79 k = 8 N = 27 k = 10 N = 92 k = 4 N = 69 k = 4 N = 20 k = 7 N = 24 k = 5 N = 39 k = 10 N = 5 k = 1 N = 55 k = 6 N = 44 k = 10 N = 48 k = 7 N = 64 k = 7 N = 37 k = 4 N = 85 k = 2 N = 27 k = 4 N = 19 k = 8 N = 14 k = 6 N = 101 k = 6 N = 67 k = 10 N = 43 k = 3 N = 49 k = 6 N = 22 k = 9 N = 75 k = 1 N = 29 k = 4 N = 39 k = 5 N = 70 k = 9 N = 11 k = 1 N = 25 k = 2 N = 29 k = 6 N = 69 k = 6 N = 31 k = 3 N = 17 k = 10 N = 104 k = 10 N = 78 k = 7 N = 17 k = 5 N = 64 k = 2 N = 99 k = 6 N = 74 k = 2 N = 65 k = 2 N = 92 k = 8 N = 30 k = 5 N = 30 k = 4 N = 52 k = 3 N = 37 k = 5 N = 40 k = 3 N = 95 k = 10 N = 32 k = 8 N = 32 k = 9 N = 83 k = 5 N = 73 k = 4 N = 95 k = 6 N = 39 k = 3 N = 26 k = 9 N = 46 k = 6 N = 26 k = 9 N = 91 k = 10 N = 63 k = 5 N = 44 k = 2 N = 14 k = 4 N = 91 k = 8 N = 79 k = 5 N = 32 k = 4 N = 15 k = 6 N = 49 k = 1 N = 69 k = 7 N = 70 k = 3 N = 33 k = 9 N = 23 k = 4 N = 27 k = 3 N = 60 k = 5 N = 51 k = 10 N = 34 k = 7 N = 18 k = 7 N = 107 k = 2 N = 13 k = 1 N = 46 k = 7 N = 27 k = 3 N = 55 k = 7 N = 35 k = 8 N = 68 k = 10 N = 94 k = 2 N = 31 k = 3 N = 47 k = 1 N = 1 k = 1 N = 45 k = 4 N = 61 k = 6 N = 28 k = 4 N = 79 k = 8 N = 33 k = 7 N = 30 k = 7 N = 84 k = 7 N = 3 k = 1 N = 11 k = 8 N = 18 k = 6 N = 90 k = 9 N = 41 k = 6 N = 29 k = 2 N = 47 k = 1 N = 27 k = 5 N = 43 k = 5 N = 107 k = 4 N = 23 k = 8 N = 51 k = 3 N = 31 k = 1 N = 72 k = 7 N = 24 k = 8 N = 27 k = 1 N = 46 k = 6 N = 52 k = 9 N = 60 k = 5 N = 82 k = 7 N = 47 k = 8 N = 64 k = 10 N = 22 k = 5 N = 37 k = 8 N = 50 k = 7 N = 39 k = 3 N = 14 k = 2 N = 39 k = 6 N = 23 k = 4 N = 11 k = 2 N = 28 k = 2 N = 16 k = 10 N = 23 k = 4 N = 110 k = 2 N = 59 k = 9 N = 21 k = 9 N = 25 k = 9 N = 55 k = 3 N = 32 k = 8 N = 86 k = 9 N = 89 k = 6 N = 11 k = 10 N = 60 k = 9 N = 121 k = 1 N = 13 k = 7 N = 91 k = 5 N = 147 k = 1 N = 66 k = 5 N = 92 k = 4 N = 97 k = 10 N = 64 k = 8 N = 78 k = 4 N = 39 k = 6 N = 33 k = 6 N = 82 k = 6 N = 15 k = 3 N = 82 k = 3 N = 28 k = 2 N = 39 k = 1 N = 73 k = 5 N = 107 k = 2 N = 63 k = 7 N = 15 k = 1 N = 36 k = 6 N = 94 k = 5 N = 22 k = 8 N = 37 k = 4 N = 19 k = 1 N = 98 k = 7 N = 57 k = 5 N = 29 k = 6 N = 29 k = 1 N = 59 k = 8 N = 55 k = 6 N = 90 k = 10 N = 37 k = 7 N = 46 k = 2 N = 24 k = 8 N = 113 k = 1 N = 62 k = 7 N = 21 k = 10 N = 25 k = 10 N = 33 k = 10 N = 31 k = 8 N = 78 k = 9 N = 36 k = 3 N = 48 k = 5 N = 44 k = 10 N = 57 k = 9 N = 41 k = 5 N = 88 k = 7 N = 14 k = 2 N = 52 k = 10 N = 42 k = 7 N = 18 k = 5 N = 34 k = 3 N = 56 k = 6 N = 61 k = 5 N = 94 k = 3 N = 50 k = 2 N = 95 k = 1 N = 61 k = 8 N = 36 k = 9 N = 76 k = 6 N = 40 k = 2 N = 125 k = 1 N = 29 k = 5 N = 50 k = 3 N = 53 k = 5 N = 74 k = 4 N = 80 k = 9 N = 49 k = 1 N = 37 k = 2 N = 73 k = 9 N = 83 k = 1 N = 101 k = 6 N = 59 k = 9 N = 60 k = 7 N = 3 k = 1 N = 29 k = 2 N = 31 k = 9 N = 12 k = 5 N = 58 k = 2 N = 52 k = 6 N = 106 k = 7 N = 55 k = 1 N = 45 k = 7 N = 120 k = 3 N = 65 k = 8 N = 101 k = 7 N = 50 k = 8 N = 88 k = 2 N = 65 k = 5 N = 61 k = 9 N = 111 k = 7 N = 127 k = 1 N = 39 k = 6 N = 63 k = 5 N = 15 k = 3 N = 56 k = 9 N = 86 k = 7 N = 70 k = 9 N = 17 k = 10 N = 18 k = 9 N = 50 k = 7 N = 23 k = 2 N = 42 k = 4 N = 67 k = 5 N = 16 k = 2 N = 103 k = 5 N = 19 k = 6 N = 11 k = 8 N = 17 k = 4 N = 52 k = 2 N = 16 k = 3 N = 17 k = 2 N = 24 k = 7 N = 23 k = 8 N = 88 k = 9 N = 94 k = 4 N = 18 k = 9 N = 42 k = 9 N = 24 k = 7 N = 53 k = 1 N = 26 k = 2 N = 64 k = 4 N = 104 k = 8 N = 50 k = 4 N = 16 k = 2 N = 42 k = 9 N = 77 k = 6 N = 71 k = 10 N = 53 k = 9 N = 42 k = 7 N = 57 k = 5 N = 67 k = 10 N = 82 k = 6 N = 53 k = 10 N = 92 k = 8 N = 76 k = 10 N = 39 k = 4 N = 50 k = 7 N = 77 k = 5 N = 21 k = 5 N = 52 k = 9 N = 69 k = 8 N = 33 k = 10 N = 74 k = 2 N = 58 k = 4 N = 99 k = 9 N = 40 k = 3 N = 58 k = 10 N = 39 k = 10 N = 25 k = 2 N = 87 k = 9 N = 15 k = 9 N = 45 k = 1 N = 40 k = 7 N = 54 k = 4 N = 17 k = 10 N = 84 k = 4 N = 56 k = 9 N = 108 k = 3 N = 24 k = 6 N = 20 k = 2 N = 94 k = 8 N = 101 k = 10 N = 179 k = 1 N = 83 k = 4 N = 46 k = 9 N = 65 k = 2 N = 33 k = 5 N = 26 k = 2 N = 78 k = 9 N = 88 k = 4 N = 35 k = 8 N = 38 k = 8 N = 16 k = 3 N = 62 k = 4 N = 8 k = 3 N = 56 k = 8 N = 16 k = 5 N = 98 k = 8 N = 7 k = 2 N = 82 k = 6 N = 47 k = 10 N = 59 k = 1 N = 64 k = 3 N = 60 k = 5 N = 43 k = 8 N = 48 k = 9 N = 20 k = 4 N = 5 k = 1 N = 65 k = 7 N = 61 k = 6 N = 47 k = 7 N = 20 k = 2 N = 92 k = 3 N = 43 k = 6 N = 96 k = 5 N = 19 k = 2 N = 34 k = 7 N = 5 k = 1 N = 30 k = 3 N = 53 k = 2 N = 52 k = 3 N = 30 k = 9 N = 62 k = 10 N = 19 k = 1 N = 74 k = 8 N = 62 k = 10 N = 67 k = 9 N = 102 k = 6 N = ...

hit rate too low (6.16%)