Cody

# Problem 2482. Card Game

Solution 1906396

Submitted on 20 Aug 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
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

z = 1×50 logical array Columns 1 through 45 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 Columns 46 through 50 1 0 1 0 1 q = Columns 1 through 30 87 0 0 96 0 0 0 0 0 0 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 0 96 0 0 0 0 0 0 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 0 0 0 0 0 0 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 0 0 0 0 0 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 0 0 0 0 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 0 0 0 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 0 0 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 0 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 0 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 0 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 0 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 0 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 0 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 0 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 0 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 0 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 0 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 0 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 0 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 200 0 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 200 200 0 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 200 200 200 0 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 200 200 200 200 81 0 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 200 200 200 200 81 200 Columns 31 through 50 0 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 200 200 200 200 81 200 Columns 31 through 50 200 0 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 200 200 200 200 81 200 Columns 31 through 50 200 200 0 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 30 87 200 200 96 200 200 200 200 200 200 88 200 200 200 200 85 200 200 98 200 84 200 200 200 200 200 200 200 81 200 Columns 31 through 50 200 200 200 0 0 99 97 0 93 0 0 0 0 0 0 94 0 79 0 91 q = Columns 1 through 3...

Undefined function or variable 'min'. Error in call (line 10) [min,index] = min(q) Error in Test1 (line 14) c = call(a(1),b);