Cody

# Problem 2482. Card Game

Solution 1709815

Submitted on 18 Jan 2019 by Ben Sawaryn
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   Pass
for i=1:randi(1000) vec = randperm(100); end vec = randperm(100); a = vec(1:50); % given to bot b = vec(51:100); % given to player you = 0; bot = 0; for i = 1:50 c = call(a(1),b); if ~ismember(c,b) while(1) end end if c>a(1) you = you + 1; else bot = bot + 1; end b(b==c)=[]; a(1)=[]; end if you<floor(50*0.75) while(1) disp('not enough wins'); end end

difference = Columns 1 through 30 66 9 48 36 29 4 -1 42 65 11 78 -18 24 26 62 13 31 68 -5 17 2 -4 22 35 34 -2 21 16 -11 33 Columns 31 through 50 -15 67 79 61 -13 14 55 76 77 41 53 69 57 19 27 -9 54 -17 37 50 difference = Columns 1 through 30 78 21 60 48 41 16 11 54 77 23 90 -6 36 38 74 25 43 80 7 29 8 34 47 46 10 33 28 1 45 -3 Columns 31 through 49 79 91 73 -1 26 67 88 89 53 65 81 69 31 39 3 66 -5 49 62 difference = Columns 1 through 30 48 -9 30 18 11 -14 -19 24 47 -7 60 -36 6 8 44 -5 13 50 -23 -1 -22 4 17 16 -20 3 -2 15 -33 49 Columns 31 through 48 61 43 -31 -4 37 58 59 23 35 51 39 1 9 -27 36 -35 19 32 difference = Columns 1 through 30 27 -30 9 -3 -10 -35 -40 3 26 -28 39 -57 -15 -13 23 -26 -8 29 -44 -22 -43 -17 -4 -5 -41 -18 -23 -6 -54 28 Columns 31 through 47 40 22 -52 -25 16 37 38 2 14 30 18 -12 -48 15 -56 -2 11 difference = Columns 1 through 30 6 -51 -12 -24 -31 -56 -61 -18 5 -49 18 -78 -36 -34 2 -47 -29 8 -65 -43 -64 -38 -25 -26 -62 -39 -44 -27 -75 7 Columns 31 through 46 19 1 -73 -46 -5 16 17 -7 9 -3 -33 -69 -6 -77 -23 -10 difference = Columns 1 through 30 7 -50 -11 -23 -30 -55 -60 -17 6 -48 19 -77 -35 -33 3 -46 -28 9 -64 -42 -63 -37 -24 -25 -61 -38 -43 -26 -74 8 Columns 31 through 45 20 -72 -45 -4 17 18 -6 10 -2 -32 -68 -5 -76 -22 -9 difference = Columns 1 through 30 69 12 51 39 32 7 2 45 68 14 81 -15 27 29 16 34 71 -2 20 -1 25 38 37 1 24 19 36 -12 70 82 Columns 31 through 44 -10 17 58 79 80 56 72 60 30 -6 57 -14 40 53 difference = Columns 1 through 30 54 -3 36 24 17 -8 -13 30 53 -1 66 -30 12 14 1 19 56 -17 5 -16 10 23 22 9 4 21 -27 55 67 -25 Columns 31 through 43 2 43 64 65 41 57 45 15 -21 42 -29 25 38 difference = Columns 1 through 30 28 -29 10 -2 -9 -34 -39 4 27 -27 40 -56 -14 -12 -7 30 -43 -21 -42 -16 -3 -4 -17 -22 -5 -53 29 41 -51 -24 Columns 31 through 42 17 38 39 15 31 19 -11 -47 16 -55 -1 12 difference = Columns 1 through 30 20 -37 2 -10 -17 -42 -47 19 -35 32 -64 -22 -20 -15 22 -51 -29 -50 -24 -11 -12 -25 -30 -13 -61 21 33 -59 -32 9 Columns 31 through 41 30 31 7 23 11 -19 -55 8 -63 -9 4 difference = Columns 1 through 30 36 -21 6 -1 -26 -31 35 -19 48 -48 -6 -4 1 38 -35 -13 -34 -8 5 4 -9 -14 3 -45 37 49 -43 -16 25 46 Columns 31 through 40 47 23 39 27 -3 -39 24 -47 7 20 difference = Columns 1 through 30 34 -23 4 -3 -28 -33 33 -21 46 -50 -8 -6 36 -37 -15 -36 -10 3 2 -11 -16 1 -47 35 47 -45 -18 23 44 45 Columns 31 through 39 21 37 25 -5 -41 22 -49 5 18 difference = Columns 1 through 30 3 -54 -27 -34 -59 -64 2 -52 15 -81 -39 -37 5 -68 -46 -67 -41 -28 -29 -42 -47 -78 4 16 -76 -49 -8 13 14 -10 Columns 31 through 38 6 -6 -36 -72 -9 -80 -26 -13 difference = Columns 1 through 30 63 6 33 26 1 -4 8 75 -21 21 23 65 -8 14 -7 19 32 31 18 13 -18 64 76 -16 11 52 73 74 50 66 Columns 31 through 37 54 24 -12 51 -20 34 47 difference = Columns 1 through 30 -9 -66 -39 -46 -76 -64 3 -93 -51 -49 -7 -80 -58 -79 -53 -40 -41 -54 -59 -90 -8 4 -88 -61 -20 1 2 -22 -6 -18 Columns 31 through 36 -48 -84 -21 -92 -38 -25 difference = Columns 1 through 30 2 -55 -28 -35 -65 -53 14 -82 -40 -38 4 -69 -47 -68 -42 -29 -30 -43 -48 -79 3 15 -77 -50 -9 13 -11 5 -7 -37 Columns 31 through 35 -73 -10 -81 -27 -14 difference = Columns 1 through 30 -43 -16 -23 -53 -41 26 -70 -28 -26 16 -57 -35 -56 -30 -17 -18 -31 -36 -67 15 27 -65 -38 3 25 1 17 5 -25 -61 Columns 31 through 34 2 -69 -15 -2 difference = Columns 1 through 30 8 35 28 -2 10 77 -19 23 25 67 -6 16 -5 21 34 33 20 15 -16 66 78 -14 13 54 76 68 56 26 -10 53 Columns 31 through 33 -18 36 49 difference = Columns 1 through 30 16 9 -21 -9 58 -38 4 6 48 -25 -3 -24 2 15 14 1 -4 -35 47 59 -33 -6 35 57 49 37 7 -29 34 -37 Columns 31 through 32 17 30 difference = Columns 1 through 30 -13 -20 -50 -38 29 -67 -25 -23 19 -54 -32 -53 -27 -14 -15 -33 -64 18 30 -62 -35 6 28 20 8 -22 -58 5 -66 -12 Column 31 1 difference = -4 -11 -41 -29 38 -58 -16 -14 28 -45 -23 -44 -18 -5 -6 -24 -55 27 39 -53 -26 15 37 29 17 -13 -49 14 -57 -3 difference = 50 43 13 25 92 -4 38 40 82 9 31 10 36 49 48 30 -1 81 93 1 28 69 91 83 71 41 5 -3 51 difference = 30 23 -7 5 72 -24 18 20 62 -11 11 -10 16 29 28 10 -21 61 73 8 49 71 63 51 21 -15 -23 31 difference = 52 45 15 94 -2 40 42 84 11 33 12 38 51 50 32 1 83 95 30 71 93 85 73 43 7 -1 53 difference = -22 -29 -59 20 -76 -34 -32 10 -63 -41 -62 -36 -23 -24 -42 9 21 -44 -3 19 11 -1 -31 -67 -75 -21 difference = -34 -41 -71 8 -88 -46 -44 -2 -75 -53 -74 -48 -35 -36 -54 9 -56 -15 7 -1 -13 -43 -79 -87 -33 difference = 43 36 6 85 -11 31 33 75 2 24 3 29 42 41 23 86 21 62 76 64 34 -2 -10 44 difference = -7 -14 -44 35 -61 -19 -17 25 -26 -47 -21 -8 -9 -27 36 -29 12 26 14 -16 -52 -60 -6 difference = 31 24 -6 73 -23 19 21 63 12 -9 17 30 29 11 74 9 64 52 22 -14 -22 32 difference = -9 -16 -46 33 -63 -21 -19 23 -28 -49 -23 -10 -11 -29 34 24 12 -18 -54 -62 -8 difference = -20 -27 -57 22 -74 -32 -30 12 -39 -60 -34 -21 -22 -40 23 13 -29 -65 -73 -19 difference = -15 -22 -52 27 -69 -27 -25 -34 -55 -29 -16 -17 -35 28 18 -24 -60 -68 -14 difference = 42 35 5 84 -12 30 32 23 2 28 41 40 22 85 33 -3 -11 43 difference = 8 1 -29 50 -46 -4 -2 -11 -6 7 6 -12 51 -1 -37 -45 9 difference = 13 -24 55 -41 1 3 -6 -1 12 11 -7 56 4 -32 -40 14 difference = 21 -16 63 -33 11 2 7 20 19 1 64 12 -24 -32 22 difference = 56 19 98 2 46 37 42 55 54 99 47 11 3 57 difference = 26 -11 68 16 7 12 25 24 69 17 -19 -27 27 difference = 55 18 97 45 41 54 53 98 46 10 2 56 difference = 29 -8 71 19 15 28 27 72 20 -16 30 difference = 28 -9 70 18 27 26 71 19 -17 29 difference = 11 -26 53 10 9 54 2 -34 12 difference = -11 -48 31 -12 -13 32 -56 -10 difference = -8 -45 -9 -10 35 -53 -7 difference = -37 -74 -38 -39 -82 -36 difference = 44 7 43 42 45 difference = -35 -36 -37 -34 difference = 46 45 47 difference = -38 -37 difference = -35