Statistics

Problem Statement for "LongBlob"

Problem Statement

A satellite image consists of a rectangular grid of 1x1 squares, each having a value of 0 or 1. We want to identify the longest "blob", where a blob is a collection of 0's that are connected orthogonally. The length of a blob is defined to be the maximum Euclidean distance between the centers of any two 0's in the blob. For example, in the following image
       0010
       1001
       0011
       0111   
there are 2 blobs. The length of the big blob is sqrt(1+9), the distance between the 0 in the lower left corner and the one in row 0, column 1. The length of the tiny blob is 0.

The difficulty is that the image may contain some noise in the form of 1's that should be 0's. We do not want to underestimate the length of the longest blob. So we will consider all different ways of choosing up to 4 different 1's and replacing them with 0's. Among all these altered images we want the length of the longest blob.

Create a class LongBlob that contains a method maxLength that is given a String[] image and that return the length of the longest blob when up to 4 of the 1's in image are regarded as noise.

Definition

Class:
LongBlob
Method:
maxLength
Parameters:
String[]
Returns:
double
Method signature:
double maxLength(String[] image)
(be sure your method is public)

Notes

  • A return value with either an absolute or relative error of less than 1.0E-9 is considered correct.

Constraints

  • image will contain between 1 and 25 elements inclusive.
  • Each element of image will contain exactly n characters, where n is between 1 and 25 inclusive.
  • Each element of image will contain only the characters '0' (zero) and '1' (one).

Examples

  1. {"0010", "1001", "0011", "0111"}

    Returns: 4.242640687119285

    This is the example given above but now by replacing 4 1's with 0's we can get a blob that includes diagonally opposite corners. The distance between two opposite corners is sqrt(9 + 9).

  2. {"101010101"}

    Returns: 7.0

    Replace the first 4 1's with 0's. Then there is one long blob, whose length is the distance between the first 0 (that used to be a 1) and the last 0.

  3. {"011111111111111110", "011111111111011110", "111111111111111110"}

    Returns: 5.0990195135927845

  4. {"011111111111111110", "011111111111010110", "111111111111111110"}

    Returns: 6.082762530298219

  5. {"0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000"}

    Returns: 33.94112549695428

  6. {"1111111111111111111111111","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000","0000000000000000000000000"}

    Returns: 33.94112549695428

  7. {"1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101"}

    Returns: 8.0

  8. {"00","00"}

    Returns: 1.4142135623730951

  9. {"01010101010"}

    Returns: 8.0

  10. {"0101","1010","0101"}

    Returns: 3.605551275463989

  11. {"01011", "11100", "01110", "11111", "01011", "11111"}

    Returns: 5.656854249492381

  12. {"11111", "11111", "11111", "11111", "11111", "11111"}

    Returns: 3.0

  13. {"11111", "11111", "01011", "11111", "11111", "11111"}

    Returns: 4.123105625617661

  14. {"11111", "11111", "01011", "11111", "11111", "01111"}

    Returns: 5.0

  15. { "11111", "01011", "11111", "11111", "01111"}

    Returns: 4.47213595499958

  16. { "1111111110001111111111", "1111111101110111111111", "1111111011111011111111", "1111110111111101111111", "1111101111111110111111", "1111011111111111011111", "1111111111011111111111", "1111111111011111111111", "1111111111011111111111", "1111111111011111111111", "1111111111011111111111", "1111111111000000000000" }

    Returns: 15.811388300841896

  17. { "1111111100001111111111", "1111111001110111111111", "1111110011111011111111", "1111100111111101111111", "1111001111111110111111", "1111101111011111011111", "1111111111011111111111", "1111111111011111111111", "1111111111011111111111", "1111111111011111111111", "1111111111011111111111", "1111111111000000000000" }

    Returns: 18.384776310850235

  18. { "1111111", "1111111", "1111111", "1111111", "1111111" }

    Returns: 3.0

  19. { "0101010101010101010101010", "1010101010101010101010101" }

    Returns: 8.0

  20. { "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010" }

    Returns: 11.0

  21. { "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010" }

    Returns: 8.0

  22. { "001100100111", "001100100111" }

    Returns: 9.055385138137417

  23. {"110011"}

    Returns: 5.0

  24. {"1111001111"}

    Returns: 5.0

  25. {"1001"}

    Returns: 3.0

  26. {"10011111"}

    Returns: 5.0

  27. {"0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000", "0000000000000000000000000" }

    Returns: 33.94112549695428

  28. {"0000000", "1100010", "0100010", "0000010", "0000010", "1010000", "0100101", "0000001", "0001110", "0000100", "0011000", "1110001", "1100001", "0111001", "1010001", "0100100", "0100000", "0100101", "0100100", "0010000", "0101110"}

    Returns: 20.8806130178211

  29. {"111010101010"}

    Returns: 8.0

  30. {"101111111111110001", "111111111111001101", "110001010101011100", "111111111111111111", "111011110001010000", "011111001100100111", "010100111101110001", "111011111101111100", "101101110111011110", "110111101100111111", "011111111111101101", "110010111100110011", "111110101111111000", "111111001011110011", "011011111101001111"}

    Returns: 16.15549442140351

  31. {"0011", "0110", "0000", "1000", "0110", "1010", "0101", "0001", "1011", "1000", "1010", "1000", "1000", "0000", "1100", "0000", "0101", "0000", "1011", "1101", "0110", "0000"}

    Returns: 21.213203435596427

  32. {"1010010010000000110010", "0010001100000000000001", "0100001000000110001001", "1000000000000000001010", "0011101011011001100000", "1010010000000001001001", "0000010000100001000100", "1000010000001000000000", "1000000000010000101100", "0010001100000100000000", "0011001000001010000000", "0101001010100010110000", "1100000000011000110000", "0000001111000010001011", "0001000101010100000011", "0000000010000000000001", "0000010010110001001000", "0011100100110000000000"}

    Returns: 27.018512172212592

  33. {"0100111111000111100110001", "1110111011111111111111010", "1100110101111101110010101", "1101111111001010111011111", "1111111001111001000111110", "1011010111111010111101000", "1001111111110011111010011", "1011110101011111100100110"}

    Returns: 12.529964086141668

  34. {"000000000", "011000000", "100001000", "010000101", "001000000", "000001000", "010001000", "100111110", "001000101", "111000000", "010000000", "100000010", "100010001", "001001101", "000110001", "100000100", "010001111", "000110010", "000010010", "010100100", "001000010"}

    Returns: 21.540659228538015

  35. {"1111010111111101011111", "0000111111010111111111", "1011111111111111111111", "1110111111111111111111", "1111111111111111111111", "1111111111111111111111", "0110111111111001111111", "1111101110111111111111", "1111111011111010111111", "1111111101111111110111", "1111111111111111101111", "1111111111111111111011", "1110111111110011111101", "1111111111111111111111", "1111111110101110111111", "1111111111111101111111", "1101111111111101111110", "0111111011111111111110", "1111011110111111111111", "1111111110111111111110"}

    Returns: 8.06225774829855

  36. {"10001000110000001", "00000011110010000", "00011001001001001", "00000101000010001", "11100001010001010", "10001100001001100", "01100000011000110", "00010001000010011", "00010110000000000", "01110100001000100", "00000100000001010", "01111100010010010", "01011000100000100", "00000001000000110", "01000001001100000", "11000100011010100"}

    Returns: 21.93171219946131

  37. {"1111111111101", "1111011111111", "1111011111111"}

    Returns: 4.123105625617661

  38. {"100010"}

    Returns: 5.0

  39. {"11", "11", "11", "11", "01", "01", "11", "10"}

    Returns: 5.0990195135927845

  40. {"00101101110", "11101111111", "11111111101"}

    Returns: 7.0

  41. {"010111100010011101010111", "111000111110110100010000", "110001000001010000000000", "000000000001000110001000", "010100100000100101001110", "000111111010001011000100", "110001000010001110110110", "001100100111000001000100", "100000001001110000111101", "000010001100111110011010", "101011100101111010001000", "101000001000111010110100", "101101100010010100100001", "000000110100110010011101", "001010010100011111110000"}

    Returns: 26.92582403567252

  42. {"1111011111101101101010", "1111111011111111111111", "1111111111111111111011", "1111111111111101100100", "1110011111111111111011", "0111111011111111101111", "0110011110110111010111", "1110111110111101110011", "1111101111111110111111"}

    Returns: 8.0

  43. {"111101010111010111", "110111111010111101", "110011110111100001", "111011011110111111", "111101101110111010", "001111011101011011", "110011101111101101", "101111111110111111", "111101111111011111", "101111011111011011", "011111101001011111", "011101111111111111", "011111010101111111", "111111111010011110", "111111101101010010", "111100111110111111", "101110111110111111", "111111111011101101", "111111011110011111", "111111101110111011", "111011111111111110"}

    Returns: 11.045361017187261

  44. {"0000001011001001000", "1000010000111000000", "0010010001010000000", "0001000010000000000", "0100000000001000000", "0010010100010000100", "0011100001000010010", "0100100111000110101", "1000010101000000011", "1000100010110011110", "0001110000000100111", "0000111110011110100"}

    Returns: 21.095023109728988

  45. {"100", "000", "100", "111", "110", "000", "100", "100", "010", "000", "010", "010", "100"}

    Returns: 12.165525060596439

  46. {"0", "0", "0", "1"}

    Returns: 3.0

  47. {"111110111111101101", "101111111111111011", "111111111111111111", "111111011110001101", "111011110111001110", "111111101111111101", "011100111111101011", "111110010011101111", "111011111110111111", "101111110011111110", "111110111101111111", "011011111111101111", "111110111011111001", "111011111000111101", "111111111111111111", "111101011111110101"}

    Returns: 9.899494936611665

  48. {"001101101010001", "001001101000000", "110011100000000", "000000100000000", "000011000010110", "111001100110000", "010100010011100", "100100100000001", "011110111111000", "001001011001001", "100100010010101", "000000101000100", "100010100110011", "010101110001101", "000011100001000", "100000000000101", "000001110100110"}

    Returns: 21.2602916254693

  49. {"000111111000110101100", "101111000111001111111", "110010111101111000101", "001100110101111100001", "101001101001001110000", "001110111011011001010", "110101111001101111111", "101111111010001011110", "011111111010000111100", "000100111011111111011", "001000101100111100110", "100101001000011001001", "111011111011110100000", "001101110101110110011", "100110111111111000011", "101010111011110111111", "011011110111011111101", "001010101111100110011", "110100111011110110011"}

    Returns: 17.11724276862369

  50. {"0011010111011000010001", "0101110101100010100011", "1111000010100010010010", "0100000110001101000100", "0101000000001101100111", "0001000101001001001000", "0001101010101011001110", "0010001000000000000110", "1111000111100110010110", "1010011011100101000000", "1011000110111000100001", "1011110000100001011000", "1100100100011001101001", "1001010110100000101001", "0001111101010100111001"}

    Returns: 25.238858928247925

  51. {"11100101101011100100", "11011111011111001111", "11110101001001001000", "11010010000011110011", "11111110110011101100", "10111111011000111111", "01010100000110000111", "10011110111111101101", "10110101010110110011", "01011111110111111110", "10110101011101110011", "11000111100010101110", "10111011111110100111", "11010000111011111001", "00000010101111011111", "00001101010111110111", "11111010111001110110", "11011110111011111111", "00001110001011111111", "11111100101100100111"}

    Returns: 17.26267650163207

  52. {"010111011101010", "100001000010000", "001100010001001", "000010100000000", "010100000000000", "000010000000000", "001000000010100", "100010101100011", "010010000001010", "101010010101010", "010000000101001", "001100000000000", "000000000010001", "000000000010000", "001000000000010", "000100100000101", "001010010010000", "011000100000001"}

    Returns: 22.02271554554524

  53. {"010000110010000100", "000110100101000000", "001110000101000101", "101110000001000000", "100100100001000001", "100000001010000101", "000001010000100100", "001000010100000000", "010101010000000010", "011100100000001000", "101001001110000000", "100000000010010010", "100000100100000000", "100000110000000000", "100110001001110000", "000110011110010001", "001011001011000001", "011010100100100101", "100000001000100000", "100001000000000010", "000000001010011000", "000000001011001101", "000001001000100100", "100101001000001000", "000100000000010000"}

    Returns: 29.410882339705484

  54. {"10010001001010000001001", "00101001101000000100110", "11100010000000100100110", "01010000001101111010100", "00110011011100000010110", "00110001011010011000100", "00000000010011000001010", "00111001110010101101110", "01110100000110101100110", "00101110110100010100101", "10000000101110100000000", "00001101000001010100111", "00010110010101110110000", "00001001100110110100010", "11110100110100000100000", "11101010010001000101010", "10101010110110010000011", "11111110100001000110110", "10111001000001001010011", "01110010011001000000000", "10011100011111001100011"}

    Returns: 29.732137494637012

  55. {"1100100011110010011101111", "0001101101101111011111011", "0000010000010000001100001", "0100110000011110011110000", "1010101001100001010011000", "0001011001001000100101000", "1100011110110100110001100", "1100010011001101000100011", "1000101101101111100010101", "1111000100001100010001001", "0111101010100000000110010", "0111101010000100000100101", "0001001011101000001101000", "0001101000010100010000001", "0001000010111000000011111", "0011101001000000100010111", "0010000011011001110101010", "0100000000000100000100100", "0110100101001100100010000"}

    Returns: 30.0

  56. {"1011110001111010000", "1100001111011001010", "1100011010111001101", "0000000010101101111", "1010111100011000110", "1111001000000000100", "0011000001000010010", "1001100101001010111", "0000100101100100010", "0100000110000110110", "0100110001001001010", "0110000010110011010", "1110001110111101110", "1111111000011100000", "1000000110101000001", "0011000100000001000", "1110111010111110101", "0101001111100110111", "1011010110111111011", "0010100110001100100", "1111011100111111000", "0011000000010101010", "0111110011001000100", "0101001101011000000"}

    Returns: 27.202941017470888

  57. {"0010010001011101000", "0010101100000100100", "0001100111001001010", "1010011001111100011", "0010000010111000001", "0000000100101111001", "0100001110000010100", "0000101001000000001", "0000000000011001101", "0011000011001001100", "1110000000010000000", "0010011100101011100", "1101000010010100010", "0010001000000011101", "1010111100000101010"}

    Returns: 22.80350850198276

  58. {"100001111000110010111", "110010111100000100011", "110101011001111010001", "100000011001110001100", "101000011010110000100", "101010001010010001001", "101100110001000000110", "101111010000000100100", "101000101010000000010", "000011101001000001010", "100100110011111101010", "101011010010110010100", "100100101000110101001", "100100000000110001111", "101001111111111110011", "001011000010101100110", "011000011100000110111", "001110100001110100000", "100111100100110110001", "011010111111010110100", "011111111011000101000"}

    Returns: 28.284271247461902

  59. {"11100011100001100000011", "10101111000111001000010", "10110000000000010000000", "00110100001010000011100", "00110001011010001100111", "01101011001000101111000", "00000011101011101110010", "00000111110110011110110", "10110111101000000001001", "01110101000100000000100", "10110001000000110010100", "10100110010101010110110", "00000000010010001100101", "00001010011001000101100", "00000100001100010000111", "01010101111110100011011"}

    Returns: 26.627053911388696

  60. {"100101111001101101", "000100001000001110", "100100100010111010", "101011111101010001", "111000011111110000", "110010111100011110", "001101110111101110", "010010111100101111", "001100101010000010", "110110101010010001", "011100110100110010", "011100100001001010", "010101100000110110", "101000001000101111", "011010101110111100", "000010110001110111", "110100011011010100", "000101000100011011", "000000100011001000", "101010110111001111"}

    Returns: 24.839484696748443

  61. {"11101101111110110111001", "10011111110101101001111", "01001110110111111111000", "11111111111110011111101", "11011111111011101110111", "10101111110101111111011", "00101111011111101111111", "01111111110101110111111", "11111111111111111111110", "00111111110111001111111", "10011111111001111101010", "11010111111111011111111", "11101111011111100111111", "11011111111011111111111", "01100111010011111111111", "11111111111010011111110", "10011111100111111110111", "01111011111100011110101", "11110111011011101111100", "11111100101111111101111", "11111011110110101111111", "11111111101111111111110", "11011101111111111111011", "11111111111010111111111", "11111111111111111111011"}

    Returns: 12.041594578792296

  62. {"0011001101010110110", "0000111110001011111", "0011111111111001000", "1001000000001000000", "1000010010010010111", "0011011011000011000", "1101011000110111101", "0001001011100100000", "1011101101101111110", "1100000000100011101", "0001101011010010000", "0001001110010000001", "0101011100101000111", "1101101111110111000", "1101001110001000000"}

    Returns: 22.80350850198276

  63. {"1010000100001000", "0110000000000101", "0000101000000100", "0001000100001100", "0010010010000100", "0000011011110010", "0100101000010001", "0000010011000000", "1000000001010110", "1010011010111001", "1011000001000110", "0000100000000100", "0100000100001000", "0001000001000010", "1010000011000001", "1000100000001100", "1001001010000100", "0100001100001000", "0000100010000110", "0110000000000010"}

    Returns: 24.20743687382041

  64. {"10000001001000000000", "01010000110000011010", "01100011101010100100", "00010000101000100101", "01000101101011110010", "00001010001011100010", "01000000100101110000", "01001000000001101100", "11100001010100000000", "00101011010000000010", "00001001000000000000", "00001001000110101000", "00110000101000000000", "00001100000100000001", "10100110001101001000"}

    Returns: 23.600847442411894

  65. {"010000010011111001", "110011001010111011", "011110010001010010", "110101000111000010", "110110011000110100", "110001110011001000", "011001101000011110", "100100001111010110", "111010111100110011", "110111011101010110", "011100011011101101", "110100000101011010", "001000001111000111", "101000011010010010", "110010110100111101", "010000101111011101"}

    Returns: 21.93171219946131

  66. {"11001101101111101111001", "11101000000111110111001", "00011111111101110001011", "11100110100100100100110", "01111101010011101111010", "11100011001010111001110", "11011111111100110010111", "11001111111000111100011", "10100101111111101011111", "11111111100110110110111", "10110010010110100110110", "11100110111001001010010", "11001010100011100000110", "11010011110111111000000", "10111010101101100111001", "01111010011111001101110", "10101000010010001101011", "11011111111101010101110", "11100001110110011011001", "00101111101010110100111", "01101111111010101010101", "01101111101010110100001", "01110000110011110010101"}

    Returns: 21.95449840010015

  67. {"0001000000000001111", "0000001100001100001", "0001000101101000000", "1000010100000011011", "0000001110000100111", "0110000000001000000", "0101000000101000000", "0000000000000111010", "1011000110011110000", "1001010011000000000", "0000000011000100000", "0001110000001001100", "1100001001100011000", "0000010000001011000", "0010001100001000010", "0000000000001000000", "0001000000010100010", "1000001010000000000", "0100000000011010101", "0011001000010100000", "0100000000000000101", "0000000001000001001", "0000001000000010001"}

    Returns: 28.42534080710379

  68. { "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111" }

    Returns: 3.0

  69. { "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111" }

    Returns: 5.0

  70. { "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "0111110111110111110111110", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "0111110111110111110111110" }

    Returns: 4.0

  71. { "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111" }

    Returns: 3.0

  72. {"01011", "11100", "01110", "11111", "01011", "11111" }

    Returns: 5.656854249492381

  73. {"11", "11" }

    Returns: 1.4142135623730951

  74. {"1111110011111011110000101", "1011110100111101010010111", "1110011011111001111110101", "1000101010111110011111001", "0110000110111100100010101", "1011111011101101100111110", "1111010101110110101111110", "0000110110101111101100111", "1110111110110111010010111", "0000111111100111111110110", "1010011111100010101110111", "1110110000111111100111011", "1010111111101010111111011", "1011111100111111101011110", "1101110111011111000101101", "0111111011111100101111101", "1111110111111011111010010", "1111111110111111111111110", "1111111110111011101011110", "1100011010101111111011111", "1111111001010111111101111", "1100111110111110000101011", "0111010001001011110011001", "1110110110111110111101101", "0110011101110110111101011" }

    Returns: 13.341664064126334

  75. {"1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1110000000011111111111111", "1110111111011111111111111", "1110101111011111111111111", "1111111111100000000010010", "1111100111111111111111111", "1111110111111111111111111", "1111110111111111111111111", "1111110111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111" }

    Returns: 22.20360331117452

  76. {"1111" }

    Returns: 3.0

  77. {"0111111111111100000000000", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0111111111111101111111111", "0000000000111101111111111" }

    Returns: 33.94112549695428

  78. {"1111111111" }

    Returns: 3.0

  79. {"1010101010101010101010101", "0101010101000101000101010", "1010101010101010001010101", "0101010101010101010101010", "1010101010001010101010101", "0101010101101100101101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "0110101010101110101010010", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101", "0101010101010101010101010", "1010101010101010101010101" }

    Returns: 12.165525060596439

  80. {"1111111111111111111111111", "1111111111111111111111111", "1111111111111110111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111011111111111111111", "1111111111111111111111111", "1111111111111111110111111", "1111111111111111110111111", "1111111111111111110111111", "1101111111111111110111111", "1111111111111111110111111", "1111111111111111110111111", "1111111111111111111111111", "1111111101010100000111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111111111111111111111111", "1111101111111111110111111", "1111111111111111111111111", "1111110111111111111111111", "1111111111111111111111111" }

    Returns: 12.206555615733702

  81. {"111", "111", "111" }

    Returns: 2.23606797749979

  82. {"000" }

    Returns: 2.0

  83. {"1111110000000000" }

    Returns: 13.0


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: