Cody

# Problem 3054. Chess ELO rating system

Solution 589620

Submitted on 2 Mar 2015 by Jean-Marie Sainthillier
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
%% players = 1000; result = 1; assert(isequal(algo400(players,result),1400))

ans = 1400

2   Pass
%% players = 1000; result = 0.5; assert(isequal(algo400(players,result),1000))

ans = 1000

3   Pass
%% assert(isequal(algo400([2000 2000],[0.5 0.5]),2000))

ans = 2000

4   Pass
%% players = [2000 2000]; result = [1 1]; assert(isequal(algo400(players,result),2400))

ans = 2400

5   Pass
%% players = [2000 2000]; result = [0.5 1]; assert(isequal(algo400(players,result),2200))

ans = 2200

6   Pass
%% players = [2000 2100 2200 2300]; result = [1 0.5 1 0.5]; assert(isequal(algo400(players,result),2350))

ans = 2350

7   Pass
%% players = 1000; result = 1; assert(isequal(algo400(players,result),1400))

ans = 1400

8   Pass
%% My last performance (my ELO is 1800) players = [1399 1280 2166 1534 1768 1791 1540]; result = [1 1 0 1 1 0 1]; assert(isequal(round(algo400(players,result)),1811))

ans = 1.8111e+03

9   Pass
%% players = [2000 2100 2200 2300]; result = [0.5 0.5 0.5 0.5]; assert(isequal(algo400(players,result),2150))

ans = 2150

10   Pass
%% Caruana perfomance in 2014 Sinquefield Cup players = [2772 2768 2877 2805 2787 2772 2768 2877 2787 2805]; result = [1 1 1 1 1 1 1 0.5 0.5 0.5]; assert(isequal(round(algo400(players,result)),3082))

ans = 3.0818e+03