Cody

# Problem 1870. GJam:2013 World B: MAD Drummer

Solution 318033

Submitted on 12 Sep 2013
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

2   Pass

3   Pass

4   Pass

5   Pass
%% v=[0 1 4 9 16 17 24 29 32 33 ]; exp=2.1428571; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

6   Pass
%% v=[0 3 8 10 18 29 36 43 46 62 ]; exp=5.3333333; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

7   Pass
%% v=[2 5 7 10 12 15 17 23 24 27 ]; exp=1.5000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

8   Pass
%% v=[0 3 8 12 14 19 28 30 31 32 ]; exp=3.4375000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

9   Pass
%% v=[0 1 4 9 16 25 36 49 64 81 ]; exp=10.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

10   Pass
%% v=[0 3 8 12 22 28 38 59 77 80 ]; exp=10.0625000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

11   Pass

12   Pass
%% v=[0 1 2 3 87 95 96 98 99 100 ]; exp=33.9166667; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

13   Fail

Error: Assertion failed.

14   Pass
%% v=[49 50 51 52 53 54 55 56 57 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

15   Pass

16   Pass

17   Pass
%% v=[3 9 11 14 16 24 29 32 34 39 ]; exp=2.5000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

18   Pass

19   Pass
%% v=[2 6 9 14 21 73 84 87 90 99 ]; exp=18.9000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

20   Pass
%% v=[48 49 50 52 53 55 56 57 59 ]; exp=0.4000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

21   Pass

22   Pass
%% v=[16 17 22 27 29 30 35 36 39 42 ]; exp=1.8750000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

23   Pass
%% v=[22 23 24 25 26 27 28 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

24   Pass
%% v=[16 18 21 22 24 27 29 31 ]; exp=0.5000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

25   Pass

26   Pass
%% v=[62 63 64 65 66 67 68 69 70 71 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

27   Pass

28   Pass
%% v=[86 87 88 89 90 91 92 93 94 95 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

29   Pass

30   Fail

Error: Assertion failed.

31   Pass

32   Pass
%% v=[49 51 53 54 56 57 59 ]; exp=0.4000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

33   Fail
%% v=[5 10 14 19 21 26 27 30 32 33 ]; exp=2.7222222; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

Error: Assertion failed.

34   Pass
%% v=[0 2 3 15 18 23 47 49 74 75 ]; exp=11.6250000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

35   Pass

36   Pass
%% v=[0 3 6 11 13 23 28 31 32 33 ]; exp=3.5000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

37   Pass

38   Pass

39   Pass

40   Pass
%% v=[60 63 67 70 72 73 76 ]; exp=1.1000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

41   Pass
%% v=[90 91 92 93 94 95 96 97 98 99 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

42   Pass

43   Pass
%% v=[0 2 3 5 9 13 14 20 21 27 ]; exp=2.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

44   Pass
%% v=[0 1 2 3 86 87 92 98 99 100 ]; exp=33.4166667; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

45   Pass

46   Pass
%% v=[3 5 8 12 67 81 88 90 95 97 ]; exp=20.4166667; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

47   Pass

48   Pass

49   Pass
%% v=[87 88 89 90 91 92 93 94 95 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

50   Fail
%% v=[6 8 14 15 18 24 29 33 37 40 ]; exp=1.8333333; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

Error: Assertion failed.

51   Pass
%% v=[1 2 5 6 9 11 12 14 15 16 ]; exp=1.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

52   Fail
%% v=[39 42 46 54 61 66 74 ]; exp=2.3333333; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

Error: Assertion failed.

53   Pass
%% v=[0 1 2 3 4 96 97 98 99 100 ]; exp=36.4000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

54   Pass
%% v=[73 74 75 76 77 78 79 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

55   Pass
%% v=[0 1 6 13 14 23 24 27 30 33 ]; exp=3.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

56   Pass

57   Pass

58   Pass

59   Pass
%% v=[0 3 5 13 15 17 23 28 29 33 ]; exp=2.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

60   Pass
%% v=[33 34 35 36 37 38 39 40 41 42 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

61   Pass
%% v=[72 73 74 75 76 77 78 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

62   Pass
%% v=[75 76 77 78 79 80 81 82 83 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

63   Pass
%% v=[0 4 8 12 16 20 24 28 32 36 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

64   Pass
%% v=[0 3 5 6 12 16 18 20 25 26 ]; exp=1.8000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

65   Pass
%% v=[24 30 36 42 43 45 49 54 56 60 ]; exp=3.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

66   Pass

67   Pass
%% v=[1 6 7 11 18 19 20 24 29 35 ]; exp=2.4000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

68   Pass
%% v=[52 53 55 56 57 58 59 60 62 63 ]; exp=0.4166667; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

69   Pass

70   Pass
%% v=[65 67 68 69 70 71 73 75 76 ]; exp=0.6666667; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

71   Pass
%% v=[0 1 3 9 16 26 44 49 61 81 ]; exp=10.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

72   Pass
%% v=[6 9 12 13 15 16 17 ]; exp=1.1666667; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

73   Pass
%% v=[0 1 5 13 22 25 31 34 44 49 ]; exp=3.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

74   Pass
%% v=[7 13 24 25 46 57 62 66 88 89 ]; exp=6.1875000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

75   Pass

76   Pass
%% v=[0 1 2 3 5 6 8 ]; exp=0.5000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

77   Pass
%% v=[84 85 86 87 88 89 90 91 92 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

78   Pass
%% v=[1 5 6 9 58 77 87 96 98 100 ]; exp=18.8333333; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

79   Pass
%% v=[7 13 15 20 21 26 29 35 39 44 ]; exp=1.8125000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

80   Pass

81   Pass

82   Pass
%% v=[35 36 37 38 39 40 41 42 43 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

83   Pass
%% v=[1 2 4 5 60 87 93 97 99 100 ]; exp=25.1666667; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

84   Pass
%% v=[0 10 20 30 40 50 60 70 80 90 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

85   Pass

86   Pass
%% v=[87 88 89 90 91 92 93 94 95 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

87   Pass
%% v=[12 13 14 16 18 20 24 26 ]; exp=1.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

88   Pass

89   Pass

90   Pass
%% v=[0 9 13 16 17 22 27 38 43 45 ]; exp=3.2857143; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

91   Pass
%% v=[35 38 40 45 48 51 56 61 66 ]; exp=1.6875000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

92   Pass
%% v=[0 3 6 9 12 88 91 94 97 100 ]; exp=29.2000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

93   Pass

94   Pass

95   Pass

96   Pass
%% v=[8 9 14 19 23 25 32 36 37 ]; exp=1.5000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

97   Pass

98   Fail
%% v=[43 45 47 50 54 58 60 61 65 66 ]; exp=1.4285714; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

Error: Assertion failed.

99   Pass
%% v=[18 19 20 21 22 23 24 ]; exp=0.0000000; MAD=Drummer(v); assert(abs(MAD-exp)<2e-6)

100   Pass