1 java.io
Character Stream: Reader
BYTE stream: InputStream
2 cup Test building
A cup, if the nth layer is broken, then in any higher than N of the floor will break, if not broken in the first layer, then in any lower than m floor will not break, give you two such cups, let you in the 100-storey high floor test, ask for a minimum number of tests to find the cup that happens to break the glass floor.
Analysis:
1 if there is only one cup, you need to go up from the 1th layer and test it by layer.
2 Now with one more cup, you can use this cup to determine the approximate range of the critical floor, and then the first Cup will continue in the way of analysis 1. The number of tests required is approximately 100^ (1/2) =10
Answer:
1 will be 100 layers of k consecutive floors, the number of floors per floor is F layer, so that the problem becomes the first cup to determine the floor area, with a second Cup to determine the critical floor problem.
2 starting from the first floor interval, the number of test times for the K-i floor interval is more than thei-1 of section K.
The maximum number of floors in a critical floor can be measured at 3 K times: s=k+ (K-1) +......+1= (k^2-k)/2
4 for the subject s>100, the solution to k=14
Extended:
1 if there are 3 cups, K can measure the maximum number of floors of the critical floor: S=s2(K) +s2(K-1) +......+3= (k^3-k)/6