Cody

# Problem 42290. GJam 2015 Rd1B: Noisy Neighbors

Solution 672262

Submitted on 20 May 2015 by Paul Berglund
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
%% m=zeros(5,2);N=8; NNexp=7; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

2   Pass
%% m=zeros(3,5);N=14; NNexp=18; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

3   Pass
%% m=zeros(1,16);N=1; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

4   Pass
%% m=zeros(3,5);N=1; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

5   Pass
%% m=zeros(8,2);N=12; NNexp=10; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

6   Pass
%% m=zeros(16,1);N=1; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

7   Pass
%% m=zeros(3,3);N=6; NNexp=3; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

8   Pass
%% m=zeros(2,6);N=12; NNexp=16; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

9   Pass
%% m=zeros(15,1);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

10   Pass
%% m=zeros(5,3);N=7; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

11   Pass
%% m=zeros(4,3);N=5; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

12   Pass
%% m=zeros(3,5);N=11; NNexp=8; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

13   Pass
%% m=zeros(7,2);N=13; NNexp=16; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

14   Pass
%% m=zeros(15,1);N=6; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

15   Pass
%% m=zeros(15,1);N=15; NNexp=14; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

16   Pass
%% m=zeros(4,4);N=9; NNexp=2; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

17   Pass
%% m=zeros(5,3);N=8; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

18   Pass
%% m=zeros(3,5);N=6; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

19   Pass
%% m=zeros(16,1);N=7; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

20   Pass
%% m=zeros(1,15);N=7; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

21   Pass
%% m=zeros(4,3);N=12; NNexp=17; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

22   Pass
%% m=zeros(5,3);N=13; NNexp=14; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

23   Pass
%% m=zeros(2,4);N=5; NNexp=2; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

24   Pass
%% m=zeros(5,3);N=5; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

25   Pass
%% m=zeros(16,1);N=16; NNexp=15; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

26   Pass
%% m=zeros(2,5);N=8; NNexp=7; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

27   Pass
%% m=zeros(5,3);N=4; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

28   Pass
%% m=zeros(5,3);N=10; NNexp=6; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

29   Pass
%% m=zeros(4,4);N=7; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

30   Pass
%% m=zeros(3,5);N=9; NNexp=3; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

31   Pass
%% m=zeros(4,2);N=2; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

32   Pass
%% m=zeros(4,4);N=15; NNexp=20; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

33   Pass
%% m=zeros(2,2);N=4; NNexp=4; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

34   Pass
%% m=zeros(5,3);N=11; NNexp=8; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

35   Pass
%% m=zeros(4,4);N=8; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

36   Pass
%% m=zeros(1,16);N=9; NNexp=1; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

37   Pass
%% m=zeros(4,4);N=16; NNexp=24; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

38   Pass
%% m=zeros(1,15);N=6; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

39   Pass
%% m=zeros(15,1);N=8; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

40   Pass
%% m=zeros(5,3);N=6; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

41   Pass
%% m=zeros(16,1);N=9; NNexp=1; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

42   Pass
%% m=zeros(3,5);N=15; NNexp=22; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

43   Pass
%% m=zeros(1,15);N=1; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

44   Pass
%% m=zeros(1,15);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

45   Pass
%% m=zeros(2,5);N=9; NNexp=10; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

46   Pass
%% m=zeros(3,5);N=10; NNexp=6; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

47   Pass
%% m=zeros(1,15);N=15; NNexp=14; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

48   Pass
%% m=zeros(3,2);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

49   Pass
%% m=zeros(5,3);N=2; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

50   Pass
%% m=zeros(5,3);N=1; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

51   Pass
%% m=zeros(5,2);N=4; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

52   Pass
%% m=zeros(3,5);N=4; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

53   Pass
%% m=zeros(2,7);N=13; NNexp=16; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

54   Pass
%% m=zeros(3,3);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

55   Pass
%% m=zeros(7,2);N=11; NNexp=10; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

56   Pass
%% m=zeros(4,4);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

57   Pass
%% m=zeros(1,1);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

58   Pass
%% m=zeros(2,6);N=9; NNexp=7; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

59   Pass
%% m=zeros(3,5);N=3; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

60   Pass
%% m=zeros(5,3);N=15; NNexp=22; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

61   Pass
%% m=zeros(5,2);N=6; NNexp=2; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

62   Pass
%% m=zeros(3,4);N=12; NNexp=17; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

63   Pass
%% m=zeros(2,3);N=6; NNexp=7; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

64   Pass
%% m=zeros(1,1);N=1; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

65   Pass
%% m=zeros(15,1);N=1; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

66   Pass
%% m=zeros(1,16);N=16; NNexp=15; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

67   Pass
%% m=zeros(2,2);N=2; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

68   Pass
%% m=zeros(3,3);N=9; NNexp=12; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

69   Pass
%% m=zeros(16,1);N=8; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

70   Pass
%% m=zeros(9,1);N=6; NNexp=2; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

71   Pass
%% m=zeros(5,3);N=12; NNexp=11; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

72   Pass
%% m=zeros(2,2);N=3; NNexp=2; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

73   Pass
%% m=zeros(3,5);N=7; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

74   Pass
%% m=zeros(7,2);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

75   Pass
%% m=zeros(4,3);N=6; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

76   Pass
%% m=zeros(2,3);N=4; NNexp=2; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

77   Pass
%% m=zeros(1,15);N=8; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

78   Pass
%% m=zeros(16,1);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

79   Pass
%% m=zeros(5,3);N=9; NNexp=3; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

80   Pass
%% m=zeros(15,1);N=7; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

81   Pass
%% m=zeros(2,4);N=6; NNexp=4; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

82   Pass
%% m=zeros(1,16);N=7; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

83   Pass
%% m=zeros(3,5);N=12; NNexp=11; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

84   Pass
%% m=zeros(1,16);N=8; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

85   Pass
%% m=zeros(4,4);N=1; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

86   Pass
%% m=zeros(3,5);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

87   Pass
%% m=zeros(3,5);N=8; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

88   Pass
%% m=zeros(1,16);N=0; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

89   Pass
%% m=zeros(5,3);N=3; NNexp=0; NN=Noisy_Neighbors(m,N); assert(isequal(NNexp,NN))

90   Fail

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!