Breeding calculation Java

2022-12-26   ES  

Title: Pressure Calculation

The high -tech laboratory of

X Planet is neatly stacked with a batch of precious metal raw materials.

The shape and size of each metal raw material are exactly the same, but the weight is different.
metal materials are strictly stacked into pyramid shapes.

                         7 
                        5 8 
                       7 8 8 
                      9 2 7 2 
                     8 1 4 9 1 
                    8 1 8 8 4 1 
                   7 9 6 1 4 5 4 
                  5 6 5 5 6 9 5 6 
                 5 5 4 7 9 3 5 5 1 
                7 5 7 9 7 4 7 3 3 1 
               4 6 4 5 5 8 8 3 2 4 3 
              1 1 3 3 1 6 6 5 5 4 4 2 
             9 9 9 2 1 9 1 9 2 9 5 7 9 
            4 3 3 7 7 9 3 6 1 3 8 8 3 7 
           3 6 8 1 5 3 9 5 8 3 8 1 8 3 3 
          8 3 2 3 3 5 5 8 5 4 2 8 6 7 6 9 
         8 1 8 1 8 4 6 2 2 1 7 9 4 2 3 3 4 
        2 8 4 2 2 9 9 2 8 3 4 9 6 3 9 4 6 9 
       7 9 7 4 9 7 6 6 2 8 9 4 1 8 1 7 2 1 6 
      9 2 8 6 4 2 7 9 5 4 1 2 5 1 7 3 9 8 3 3 
     5 2 1 6 7 9 3 2 8 9 5 5 6 6 6 2 1 8 7 9 9 
    6 7 1 8 8 7 5 3 6 5 4 7 3 4 6 7 8 1 3 2 7 4 
   2 2 6 3 5 3 4 9 2 4 5 7 6 6 3 2 7 2 4 8 5 5 4 
  7 4 4 5 8 3 3 8 1 8 6 3 2 1 6 2 6 4 6 3 8 2 9 6 
 1 2 4 1 3 3 5 3 4 9 6 3 8 6 5 9 1 5 3 2 6 8 8 5 3 
2 2 7 9 3 3 2 8 6 9 8 4 4 9 5 8 2 6 3 4 8 4 9 3 8 8 

7 7 7 9 7 5 2 7 9 2 5 1 9 2 6 5 3 9 3 5 7 3 5 4 2 8 9
7 7 6 6 8 7 5 5 8 2 4 7 7 4 7 2 6 9 2 1 8 2 9 8 5 7 3 6
5 9 4 5 5 7 5 5 6 3 5 3 9 5 8 9 5 4 1 2 6 1 4 3 5 3 2 4 1
X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X

The number of numbers represents the weight of the metal block (large measurement unit).
The next layer of X represents 30 high -precision electronic scales.

Suppose the weight of each raw material is accurately on the two metal blocks below,
Finally, the weight of all metal blocks is strictly and accurately divided into the bottom -level electronic scale.

The measurement unit of
electronic scale is small, so the number displayed is large.

Staff found that the number of electronic scales with the smallest reading is: 2086458231

Please calculate: What is the number of electronic scales with the largest reading?

Note: What needs to be submitted is an integer, do not fill in any extra content.


Benben has something to say:
continuously divide 2, add to the following, except 2, add to the following, … will not overflow the floating point accuracy, right?
1 1 There is something:
Afraid that it is not easy to do, it is not good to expand each number a certain number.

Import java.util.scanner; 


 public class no4 {{ 
 Public Static void main (string [] args) { 
 Scanner sc = New Scanner (System.in); 
 double b [] [] = { 
 {7}, 
 {5, 8}, 
 {7, 8,8}, 
 {9, 2, 7, 2}, 
 {8, 1,4, 9, 1}, 
 {8, 1, 8,8, 4,1}, 
 {7, 9, 6, 1, 4, 5, 4}, 
 {5, 6, 5, 5, 6, 9, 5, 6}, 
 {5,5, 4, 7, 9, 3, 5, 5,1}, 
 {7, 5, 7, 9, 7, 4, 7, 7, 3, 3, 3, 1}, 
 {4, 6,4, 5, 5, 8, 8, 8, 3, 2, 3}, 
 {1, 1, 3, 3, 1, 6, 6, 5, 5, 4, 4, 2}, 
 {9, 9, 9, 2, 1, 9, 1, 9, 9, 9, 5, 9}, 
 {4, 3, 3, 7, 7, 9, 3, 6, 1, 3, 8, 8, 3, 7}, 
 {3, 6, 8, 1, 5, 3, 9, 5, 8, 8, 8, 8, 8, 3, 3}, 
 {8, 3, 2, 3, 3, 5, 5, 8, 5, 4, 2, 8, 6, 6, 9, 9}, 
 {8, 1, 8, 1, 8, 4, 6, 2, 2, 1, 7, 9, 4, 2, 3, 3, 4}, 
 {2, 8, 4, 2, 2, 9, 9, 2, 8, 3, 4, 9, 9, 9, 9, 9, 9}, 
 {7, 9, 7, 4, 9, 7, 6, 6, 2, 8, 9, 4, 1, 8, 1, 7, 2, 6}, 
 {9, 2, 8, 6, 4, 2, 7, 9, 5, 4, 1, 2, 5, 1, 7, 9, 8, 3, 3, 3}, 
 {5, 2, 1, 6, 7, 9, 3, 2, 9, 9, 5, 5, 6, 6, 6, 2, 1, 8, 9, 9, 9}, 
 {6, 7, 1, 8, 8, 7, 5, 5, 5, 5, 7, 7, 4, 6, 7, 8, 1, 3, 2, 7, 4}, 
 {2, 2, 6, 3, 5, 3, 4, 9, 2, 4, 5, 5, 6, 6, 3, 2, 2, 4, 8, 5, 5, 4}, 4}, 4}, 4}, 4} 
 {7, 4, 4, 5, 8, 3, 3, 8, 8, 8, 3, 3, 2, 1, 6, 6, 6, 3, 8, 2, 9, 6}, 
 {1, 2, 4, 1, 3, 3, 5, 3, 4, 9, 9, 3, 8, 5, 9, 5, 5, 3, 6, 6, 8, 5, 3, 3 }, 
 , 8}, 
 {7, 7, 7, 9, 7, 5, 2, 7, 9, 5, 5, 9, 9, 5, 5, 9, 5, 7, 3, 5, 4, 2, 2 , 8, 9,}, 
 , 7, 3, 6}, 
 , 3, 2, 4, 1}, 
 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 , 0,0,0,0,0} // This line 0 is the initial value of Libra; 
 }; 
 for (int i = 1; I <b.Length; i ++) { 
 for (int j = 0; j <i+1; j ++) { 
 if (J-1 <0) {// If J-1 is less than zero, the array will cross the border, so if it is less than zero, it will execute this operation and then the cycle of Kang Hoe; 
 b [i] [j] =+b [i-1] [j]/2+b [i] [j]; 
 constinue; 
 } if (j == i) {// If J == I above, J will also cross the boundary, because the length of each line is more than the previous president, so the operation below is executed. 
 b [i] [j] = b [i-1] [j-1]/2+b [i] [j]; 
 constinue; 
 } 
 b [i] [j] = b [i-1] [j-1]/2+b [i-1] [j]/2+b [i] [j]; 
 } 
 } 
 
 for (int i = 0; I <b.Length; i ++) { 
 for (int j = 0; j <i; j ++) { 
 System.out.println (b [i] [j]); 
 } 
 } 
 
 double [] ee = new double [30]; // Define the value of a array stored Libra 
 for (int i = 0; i <30; i ++) { 
 ee [i] = b [29] [i]; 
 } 
 // Below is relatively small 
 for (int i = 0; I <ee.length; i ++) { 
 for (int j = i; j <ee.length; j ++) { 
 if (ee [i]> ee [j]) { 
 double ha = ee [i]; 
 ee [i] = ee [j]; 
 ee [j] = ha; 
 } 
 } 
 } 
 // NB is the smallest NBB is the largest 
 double nb = ee [0]; 
 double nbb = ee [29]; 
 System.out.println (2086458231/nb*nbb); // Conversion unit output 

 } 
 }

source

Random Posts

Thesis reading: FPN

QPROGressDialog quickly realized the display interface of progress

router set dmz steps

Center7 installation ES

jsp: usebean, jsp: setproperty Detailed explanation