Detailed explanation of the real questions of the 2018 9th Blue Bridge Cup JavaC Group Provincial Competition

content

Question 1: When will I return

Question 2: The monkey divides the banana

Question 3: Array of Letters

Question 4: Which lucky number

Question 5: Book Number Verification

Question 6: Printing a Big X

Question 7: Abbreviated Summation

Question 8: Isosceles Triangle

Question 9: Children's Worship Circle

Question 10: Fall Resistance Index

 


Problem solving with update

Question 1: When will I return

Topic description

Xiao Ming was kidnapped by unknown forces. After being thrown to the X star station, he never cared again. Xiao Ming learned that there are spaceships flying to the earth every day, but he needs a ticket of 108 yuan, but he has no money.
He decided to work in x Star Wars. The kind boss promised to include room and board and give him 1 yuan on the first day.
And, every day after that is 2 yuan more than the day before, until he has enough money to buy a ticket.
Please calculate, Xiao Ming will be able to collect 108 yuan in a few days and return to Earth.

The required submission is an integer representing the number of days. Please do not submit any superfluous content.

Question 2: The monkey divides the banana

Topic description

5 monkeys are good friends and fell asleep on the coconut tree by the sea. During this period, a merchant ship left a bunch of bananas on the beach.
The first monkey wakes up and divides the bananas into 5 piles. If there is one left, he eats and hides his portion and goes to sleep.
The second monkey wakes up and divides the bananas into 5 piles again. If there are 2 left, they eat and hide their portion and go to sleep.
The third monkey wakes up and divides the bananas into 5 piles again. If there are 3 remaining bananas, they eat and hide their own portion and go to sleep.
The fourth monkey wakes up, divides the bananas into 5 piles again, and eats the remaining 4 bananas and hides their portion to go to sleep.
The fifth monkey wakes up and divides the bananas into 5 piles again, haha, just not left!

Calculate the minimum number of bananas to start with.

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

Question 3: Array of Letters

Topic description

Look carefully, you will find: in the following 8x8 square, there is a hidden sequence of letters: "LANQIAO".

SLANQIAO
ZOEXCCGB
MOAYWKHI
BCCIPLJQ
SLANQIAO
RSFWFNYA
XIFZVWAL
COAIQNAL

We agree: the sequence can be horizontal, vertical, or oblique;
and the direction is unlimited (in fact, there are a total of 8 directions).
There are a total of 4 strings that meet the requirements in the above figure.

Below is a larger (100x100) square matrix of letters.
Can you count how many "LANQIAO"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FWILWFB
QWNLTPMCYHRSKVHXLONRANWKWXUTHYQLIOFKGDBMSWDRCYRKVSAGGRJMWQYQFLMUIGGCLAUQAACTYLPZEOJBHMWRKHCRXGTGRMUP
CPQKJRBLYDNPUGHCRBVYBAIRVCAWLBWVWCMKNBIRKJOUGYQEBQRHDSTWXDIWGRVMLIJFBWHLHCDAAVUDLZSCGQNOUXVUIVIZZZMD
NMHGYPFUUDWKQGTAKKGCDFJFYJFNRZVXDPGZEAMWQVQZODKTXHIYFVKJSSAWVHYCUCZMLLBPXTILDYJQEMWDRUFKISOUVPUDTYPB
FDAQUBXHUJYTAYNWVIJNUSQDTQDEMUAPWXRYUWONTBDZCHZOUEGPMWEZTQWWSHAYOBWVTDIMZYNVNZKUHOFCQKPHJXWNRCGUJEKO
WSDAUGUTVWCVHEMOIRJJGTANUWTSAIXXEVZTBDHPGSRHHVWCDZVZYRJTLONIJVXEATHQXOUKBIGZONFRSZIOGWNTYAJYLQCGEOWY

Please submit an integer without any extras.

Question 4: Which lucky number

Topic description

Tourists who travel to planet x are given an integer number as a tourist number.
The king of star x has a quirk, he only likes the numbers 3, 5 and 7.
The king stipulated that if the number of tourists only contains factors: 3, 5, 7, they can get a prize.

Let's look at the first 10 lucky numbers:
3 5 7 9 15 21 25 27 35 45
so the 11th lucky number is: 49

Xiao Ming received a lucky number 59084709587505. When he went to receive the prize, he was asked to say exactly which lucky number it was, otherwise he would not receive the prize.

Please help Xiao Ming calculate, 59084709587505 is the first lucky number.

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

Question 5: Book Number Verification

Topic description

Since 2004, the International ISBN Center has published the "Guide to the 13-Digit ISBN".
The original 10-digit book number is preceded by 978 as the product classification identifier; the verification rules have also changed.
The weighting algorithm of the check digit is different from that of the 10-bit ISBN. The specific algorithm is:
multiply the odd-numbered bits in the first 12 bits of the ISBN by 1 (counting from the left), multiply the even-numbered bits by 3, and the sum of the products is 10 is the modulo, and the difference between 10 and the modulo value is modulo 10 (that is, taking the number of one digit) to get the value of the check digit, and its value range should be 0~9.

The following program implements the algorithm, please read the source code carefully and fill in the missing parts.

public class A
{     static boolean f(String s){         int k=1;         int sum = 0;         for(int i=0; i<s.length(); i++){             char c = s.charAt(i);             if(c=='-' || c==' ') continue;             sum += ______________________________;  //填空             k++;             if(k>12) break;          }         return s.charAt(s.length()-1)-'0' == (10-sum % 10)%10;     }     public static void main(String[] args){         System.out.println(f("978-7-301-04815-3"));         System.out.println(f("978-7-115-38821-6"));     } }










        


    





Note: Only submit vacant code, do not copy code that already exists.

Question 6: Printing a Big X

Topic description

The purpose of the following program is to print a big X on the console.
Two parameters can be controlled: the height of the graphic, and the width of the pen.

Use the test data in the program to output the effect:
(If there is a problem with the display, you can refer to p1.png)

Height=15, Pen Width=3
*** ***
 *** ***
  *** ***
   *** ***
    *** ***
     *** ***
      *****
       * **
      *****
     *** ***
    *** ***
   *** ***
  *** ***
 *** ***
*** ***
height=8, pen width= 5
***** *****
 **********
  ********
   ******
   ******
  ********
 * *********
***** *****

Please analyze the program flow carefully and fill in the missing codes.


public class A
{     static void f(int h, int w){         System.out.println(String.format("高度=%d, 笔宽=%d",h,w));         int a1 = 0;         int a2 = h - 1;         for(int k=0; k<h; k++){             int p = Math.min(a1,a2);             int q = Math.max(a1+w,a2+w);             for(int i=0; i<p; i++) System.out.print(" ");             if(q-p<w*2){                 ____________________________________________ ; //填空             }             else{                 for(int i=0; i<w; i++) System.out.print("*");                 for(int i=0; i<q-p-w*2; i++) System.out.print(" ");




        



            

            






                for(int i=0; i<w; i++) System.out.print("*");
            }
            System.out.println();
            a1++;
            a2--;
        }
    }
    
    public static void main(String[] args){         f(15,3);         f(8,5);     } }



Note: Only fill in missing codes, do not copy existing codes.

Question 7: Abbreviated Summation

Topic description

Before the popularization of electronic computers, people often used a rough method to check whether the four arithmetic operations were correct.
For example: 248 * 15 = 3720
sum the multiplier and the multiplicand bit by bit, if it is a multi-digit sum, then add it bit by bit until it is 1 digit, get
2 + 4 + 8 = 14 ==> 1 + 4 = 5;
1 + 5 = 6
5 * 6
and the bit-by-bit summation of the result is 3
5 * 6 The bit-by-bit summation of the result is consistent with 3, indicating that it is very likely to be correct! ! (Cannot rule out errors)

Please write a computer program that sums a given string bit by bit:
the input is a string consisting of numbers, representing n digits (n<1000);
the output is a single number, representing repeated bitwise summation result.

Example:
Enter:
35379

The program should output:
9

Another example:
Input:
7583676109608471656473500295825

The program should output:
1


Resource convention:
peak memory consumption (including virtual machine) < 256M
CPU consumption < 1000ms


Please output strictly according to the requirements, and do not superficially print superfluous content like: "Please enter...".

All code is placed in the same source file, after debugging, copy and submit the source code.
Don't use the package statement. Do not use features of jdk1.7 and above.
The name of the main class must be: Main, otherwise it will be processed as invalid code.

Question 8: Isosceles Triangle

Topic description

This problem requires you to output an isosceles triangle composed of numbers to the console.
The specific steps are:
1. First use the natural numbers of 1, 2, 3, ... to make a long enough string
2. Use this string to fill the three sides of the triangle. Start at the top vertex and fill in counter-clockwise.
For example, when the triangle height is 8:

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

When the display is not correct, please refer to: p1.png

Input, a positive integer n (3<n<300), representing the height of the triangle
Output, an isosceles triangle filled with numbers.

For the convenience of evaluation, we require spaces to be replaced with ".".

Example:
Enter:
5

The program should output:
....1
...
2.1..3...2.4
.....1
567891011

Another example:
enter:
10

The program should output:
.........1
........2.2
.......3...2
......4.....2
.. ...5.......1
....6.........2
...7............
0..8.... .........2
.9 .............9
1011121314151617181

Another example:
enter:
15

The program should output:

..............1
.............2.3
............3...2
...........4.....3
..........5.......1
.........6.........3
........7...........0
.......8.............3
......9...............9
.....1.................2
....0...................8
...1.....................2
..1.......................7
.1.........................2
21314151617181920212223242526


Resource convention:
peak memory consumption (including virtual machine) < 256M
CPU consumption < 1000ms


Please output strictly according to the requirements, and do not superficially print superfluous content like: "Please enter...".

All code is placed in the same source file, after debugging, copy and submit the source code.
Don't use the package statement. Do not use features of jdk1.7 and above.
The name of the main class must be: Main, otherwise it will be processed as invalid code.

Question 9: Children's Worship Circle

Topic description

There are N children in the class, each of whom has a child (or himself) whom he admires the most.
In a game, children are required to sit in a circle, and
each child has the child he admires most on his right.
Find the maximum number of people in the circle that meet the conditions?

Children numbered 1,2,3,...N
enter the first line, an integer N (3<N<100000)
and N integers in the next line, separated by spaces.

It is required to output an integer representing the number of people in the largest circle that satisfies the condition.

Example:
Enter:
9
3 4 2 5 3 8 4 6 9

Then the program should output:
4

Explanation:
As shown in Figure p1.png, the worship relationship is represented by arrows, and red means not in the circle.
Obviously, the largest cycle is the cycle formed by [2 4 5 3]


Another example:
Input:
30
22 28 16 6 27 21 30 1 29 10 9 14 24 11 7 2 8 5 26 4 12 3 25 18 20 19 23 17 13 15

The program should output:
16

Resource convention:
peak memory consumption (including virtual machine) < 256M
CPU consumption < 1000ms


Please output strictly according to the requirements, and do not superficially print superfluous content like: "Please enter...".

All code is placed in the same source file, after debugging, copy and submit the source code.
Don't use the package statement. Do not use features of jdk1.7 and above.
The name of the main class must be: Main, otherwise it will be processed as invalid code.

Question 10: Fall Resistance Index

Topic description

 

The inhabitants of Planet X are not very good-tempered, but fortunately, the only abnormal behavior when they are angry is to drop their mobile phones.
Major manufacturers have also launched a variety of drop-resistant mobile phones. The Quality Supervision Bureau of Planet X stipulates that mobile phones must pass a drop test and be assessed a drop resistance index before they are allowed to be marketed for circulation.

Planet X has a lot of towering towers that are just right for a drop test. Each floor of the tower is the same height, with a slight difference on Earth, their first floor is not the ground, but is equivalent to our 2nd floor.

If the phone is dropped from the 7th layer without breaking, but the 8th layer is broken, the phone's drop resistance index = 7.
In particular, if the phone is broken when dropped from the first layer, the drop resistance index = 0.
If the nth floor of the top floor of the tower is not broken, then the drop resistance index = n

In order to reduce the number of tests, 3 mobile phones were sampled from each manufacturer to participate in the test.

If the height of the test tower is known, and the best strategy is used, what is the maximum number of tests required to determine the phone's drop resistance index under the worst luck?

Input data, an integer n (3<n<10000), which represents the height of the test tower.
Output an integer indicating how many times to test at most.

Example:
Enter:
3

The program should output:
2

Explanation:
If mobile phone a is thrown from the 2nd floor, if it is broken, then throw mobile phone b from the 1st floor; otherwise, mobile phone a will continue to be dropped on the 3rd floor

Another example:
enter:
7

The program should output:
3

Explanation:
a mobile phone is thrown from the 4th floor, if it is broken, then there are 3 layers below, b, c, two mobile phones can measure the index twice
; easy to measure.

Resource convention:
peak memory consumption (including virtual machine) < 256M
CPU consumption < 1000ms


Please output strictly according to the requirements, and do not superficially print superfluous content like: "Please enter...".

All code is placed in the same source file, after debugging, copy and submit the source code.
Don't use the package statement. Do not use features of jdk1.7 and above.
The name of the main class must be: Main, otherwise it will be processed as invalid code.

---------------------------------
Benben has something to say:
I think 3 mobile phones are too difficult, if there are 2 Mobile phones can also be considered.

Crooked has something to say:
what are you thinking, you! If a mobile phone is still programmed with you? In that case, it has to be measured layer by layer from bottom to top.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326142462&siteId=291194637