Repairs Design Furniture

Ege on computer science demo. Changes in demo version of the EGE on computer science. Description of input and output

Place 2 tasks. Demo version of the EGE on computer science 2019 (FIPI):

Misha filled the truth table function

(¬x ∧ ¬y) ∨ (y≡z) ∨ ¬W

but I managed to fill out only a fragment of three different lines, not even specifying what the table column corresponds to each of the variables w, X, Y, Z.

Determine what column of the table corresponds each of the variables w, X, Y, Z.

Disaster 3 tasks. Demo version of the EGE on computer science 2019 (FIPI):

The figure below shows the scheme of the roads of the n-district area, in the table as a star designated the presence of the road from one local location to another. The absence of the stars means that there is no way.


Each settlement in the scheme corresponds to its number in the table, but it is unknown, which number.

Determine which locations in the table can correspond to settlements B. and C. in the scheme. In response, write down these two numbers in the increasing order without spaces and punctuation signs.

Dislease 4 tasks. Demo version of the EGE on computer science 2019 (FIPI):

Below are two fragments of tables from the database on the inhabitants of the microdistrict. Each line of Table 2 contains information about the child and about one of his parents. The information is represented by the value of the ID field in the corresponding string of the table 1.
Based on the given data, determine the greatest difference between the years of birth of native sisters. When calculating the response, consider only information from the above table fragments.


Analysis of 5 tasks. Demo version of the EGE on computer science 2019 (FIPI):

For encoding some sequence consisting of letters A B C D E F, decided to use an uneven binary code, fano satisfying condition. For letter BUT Used code word 0 ; For letter B. - codeword 10 .
What is the smallest possible amount of code words for letters In, g, d, e?

Note. The Fano Condition means that no code word is the beginning of another code word. This provides the ability to unambiguously decrypt encoded messages.

Hearing 6 tasks. Demo version of the EGE on computer science 2019 (FIPI):

The input of the algorithm is given a natural number N.. The algorithm builds a new number on it. R. in the following way.

1) A binary recording of N. has been built.
2) To this entry adds to the right two more discharges at the following rule:

If a N. You can finish first at the end of the number (right) zero, and then unit. Otherwise if N. odd, on the right finishes first unit, and then zero.

For example, a binary recording of 100 numbers 4 will be converted to 10001, and the binary entry 111 of the number 7 will be converted to 11110.

The recording obtained in this way (in it for two discharges is greater than in the recording of the source number N.) is a binary entry of the number R. - The result of this algorithm.

Specify minimum number R.that more than 102. And it may be the result of the work of this algorithm. In response, write this number in the decimal number system.

Demals 7 tasks. Demo version of the EGE on computer science 2019 (FIPI):

Dan fragment of the spreadsheet. From cell C3. in cell. D4. The formula was copied. When copying the address of the cells in the formula, they have changed automatically.

What was the numerical value of the formula in the cell D4.?


Hearing 8 tasks. Demo version of the EGE on computer science 2019 (FIPI):

Record the number that will be printed as a result of the following program.

1 2 3 4 5 6 7 8 9 10 11 VAR S, N: Integer; Begin S: \u003d 0; n: \u003d 75; While S + N< 150 do begin s : = s + 15 ; n : = n - 5 end ; writeln (n) end .

vAR S, N: Integer; Begin S: \u003d 0; n: \u003d 75; While S + N< 150 do begin s:= s + 15; n:= n - 5 end; writeln(n) end.

Hearing 9 tasks. Demo version of the EGE on computer science 2019 (FIPI):

Automatic camera produces raster images in size 200 × 256. pixels. To coding the color of each pixel, the same amount of bits are used, pixel codes are written to the file one by one without intervals. The file with the image can not exceed 65 KB Excluding the size of the file header.

What maximum number of colors Can I use in the palette?

Dislease of 10 tasks. Demo exam in computer science 2019 (FIPI):

Vasya is 5-letter Words in which there are only letters S, and, m, and, and in each word there is exactly one vowel letter And she meets exactly 1 time. Each of the permissible consonants can occur in the word Any number of times or not to meet at all. A word is considered to be any permissible sequence of letters, not necessarily meaningful.

How many words that you can write vasya?

Demals 11 tasks. Demo exam in computer science 2019 (FIPI):

The recursive algorithm F is recorded below.

Pascal:

1 2 3 4 5 6 7 8 9 Procedure F (n: integer); Begin IF n\u003e 0 Then Begin F (n - 1); Write (N); F (n - 2) END END;

procedure F (n: integer); Begin IF n\u003e 0 Then Begin F (n - 1); Write (N); F (n - 2) END END;

Write down in a row without spaces and dividers all the numbers that will be printed on the screen when configuring F (4). Numbers must be recorded in the same order in which they are displayed on the screen.

Demals 12 tasks. Demo version of the EGE on computer science 2019 (FIPI):

In the TCP / IP network terminology, a binary number is called a binary number that determines which part of the network node IP address refers to the network address, and which is to the address of the node itself in this network. Typically, the mask is recorded according to the same rules as the IP address, - in the form of four bytes, and each byte is written in the form of a decimal number. At the same time, in the mask, first (in the older discharges) cost units, and then from some discharge - zeros. The network address is obtained as a result of the use of the bonnetic conjunction to the specified node IP address and mask.

For example, if the IP address of the node is 231.32.255.131, and the mask is 255.255.240.0, the address of the network is equal to 231.32.240.0.

For a node with an IP address 117.191.37.84 Network address is equal 117.191.37.80 . What is equal to the fewest Possible value of the latter ( right right) byte masks? Answer write in the form of a decimal number.

Disaster 13 tasks. Demo exam in computer science 2019 (FIPI):

When registering in a computer system, each user is issued a password consisting of 7 characters and containing only characters from 26 - Symxual set of capital Latin letters. In the database for storing information about each user, the same and minimum possible integer byte. At the same time, the inventive coding of passwords is used, all symbols are encoded the same and the minimum possible amount. bit. In addition to the password itself, for each user in the system, more information is stored, for which a whole number of bytes is allocated; This number is the same for all users.

For storing information about 30 users needed 600 bytes.

How much byte is allocated for storage additional information About one user? In response, write down only an integer - the number of bytes.

Analysis of 14 tasks. Demo version of the EGE on computer science 2019 (FIPI):

Artist editor receives a number of numbers on the line and transforms it. The editor can execute two commands, in both commands V and W denote the chains of numbers.
A) Replace (V, W).
This command replaces the first on the left entry of the chain in the string. v. On chain w..

For example, command execution (111, 27) converts a string of 05111150 to a string of 0527150.

If the row does not occur a chain v.The execution of the command to replace (V, W) does not change this string.
B) Found (V).
This team checks whether the chain meets v. In the artist string editor. If it occurs, the command returns a logical value. "true"otherwise returns the value "False". The string of the artist does not change.

Which line will result in applying the program below to a string consisting of 82 Going in a row numbers 1? In response, write down the resulting string.

The beginning was still found (11111) or found (888) if there were (11111), then replace (11111, 88) otherwise if it was (888), then replace (888, 8) end if end if the end is the end

Hearing 15 tasks. Demo version of the EGE on computer science 2019 (FIPI):

The figure shows the scheme of roads binding cities A, B, B, G, D, E, F, Z, and, K, L, M. On each road, you can only move in one direction indicated by the arrow.

How many different ways exist from the city BUT in town M.passing through the city L.?


Dislease of 16 tasks. Demo version of the EGE on computer science 2019 (FIPI):

The value of the arithmetic expression 9 7 + 3 21 – 9 recorded in the number system with the base 3 . How many numbers "2" is contained in this record?

Demals 17 tasks. Demo version of the EGE on computer science 2019 (FIPI):

In the language of search server requests to indicate a logical operation "OR" Used symbol «|» , and to designate a logical operation "AND" - Symbol «&» .

The table shows the requests and the number of pages found on them some segment of the Internet.


How many pages (in hundreds of thousands) will be found on request
Throat | Ship | Nose ?
It is believed that all requests were performed almost simultaneously, so that the set of pages containing all the desired words did not change during the execution of requests.

Demals 18 tasks. Demo version of the EGE on computer science 2019 (FIPI):

For what the greatest integer non-negative number BUT expression

(48 ≠ y + 2x) ∨ (a

identical true. Takes up value 1 with any whole non-negative x. and y.?

Collapse 19 tasks. Demo version of the EGE on computer science 2019 (FIPI):

The program uses a one-dimensional integer array A. With indexes OT. 0 before 9 . The values \u200b\u200bof the elements are equal 2, 4, 3, 6, 3, 7, 8, 2, 9, 1 Accordingly, i.e. A \u003d 2., A \u003d 4. etc.

Determine the value of the variable c. After performing the next fragment of this program.

Collapse 20 tasks. Demo version of the EGE on computer science 2019 (FIPI):

The algorithm is recorded below. Having received a natural decimal number on the entrance x.This algorithm prints two numbers: L. and M.. Specify the greatest number x., when entering which the algorithm prints first 21 , and then 3 .

VAR X, L, M: Integer; Begin ReadLN (X); L: \u003d 1; M: \u003d 0; While x\u003e 0 do begin m: \u003d m + 1; IF x MOD 2<> 0 THEN L: \u003d L * (x MOD 8); x: \u003d x div 8 end; Writeln (L); Writeln (M) End.

vAR X, L, M: Integer; Begin ReadLN (X); L: \u003d 1; M: \u003d 0; While x\u003e 0 do begin m: \u003d m + 1; IF x MOD 2<> 0 THEN L: \u003d L * (x MOD 8); x: \u003d x div 8 end; Writeln (L); Writeln (M) End.

Demals 21 tasks. Demo version of the EGE on computer science 2019 (FIPI):

Determine the number that will be printed as a result of the implementation of the next algorithm.

Note. The ABS feature returns the absolute value of its input parameter.

Pascal:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 VAR A, B, T, M, R: LONGINT; FUNCTION F (X: LONGINT): LONGINT; Begin F: \u003d ABS (ABS (X - 6) + ABS (X + 6) - 16) + 2; end; Begin A: \u003d - 20; B: \u003d 20; M: \u003d A; R: \u003d F (a); For T: \u003d A to b DO Begin if (F (T)<= R) then begin M : = t; R : = F(t) end end ; write (M + R) end .

vAR A, B, T, M, R: LONGINT; FUNCTION F (X: LONGINT): LONGINT; Begin F: \u003d ABS (ABS (X - 6) + ABS (X + 6) - 16) + 2; end; Begin A: \u003d -20; B: \u003d 20; M: \u003d A; R: \u003d F (A); For T: \u003d A to b DO Begin if (F (T)<= R) then begin M:= t; R:= F(t) end end; write(M + R) end.

Demals 22 tasks. Demo version of the EGE on computer science 2019 (FIPI):

Contractor The calculator converts the number written on the screen.
The artist has three teams that are assigned rooms:

1. Adjust 2.
2. Multiply to 2
3. Add 3.

The first of them increases the number on the screen by 2, the second multiplies it to 2, the third increases it to 3.
The computer program is a sequence of commands.

How many of these programs that convert the initial number 2 Number 22 And at the same time the trajectory of the program calculations contains the number 11.?

The trajectory of the program calculation is the sequence of the results of the execution of all program commands.

For example, for the program 123, with the source number 7, the trajectory will consist of numbers 9, 18, 21.

Hearing 23 tasks. Demo version of the EGE on computer science 2019 (FIPI):

How many different sets of logical variables x1, x2, ... x7, y1, y2, ... y7who satisfy all the conditions listed below?

(Y1 → (Y2 ∧ x1)) ∧ (x1 → x2) \u003d 1 (y2 → (y3 ∧ x2)) ∧ (x2 → x3) \u003d 1 ... (y6 → (y7 ∧ x6)) ∧ (x6 → x7) \u003d 1 y7 → x7 \u003d 1

In response not necessary List all different sets of variable values x1, x2, ... x7, y1, y2, ... y7under which this system of equalities is performed.
As an answer, you need to specify the number of such sets.

Dislease 24 tasks. Demo version of the EGE on computer science 2019 (FIPI):

The processing comes in a natural number not exceeding 109 . Need to write a program that displays minimal reader of this number. If there are no read numbers, it is required to display "NO". Programmer wrote the program wrong:

Pascal:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 VAR N, DIGIT, MINDIGIT: LONGINT; begin readln (n); Mindigit: \u003d N MOD 10; While N\u003e 0 Do Begin Digit: \u003d n MOD 10; If Digit MOD 2 \u003d 0 THEN IF Digit< minDigit then minDigit : = digit; N : = N div 10 ; end ; if minDigit = 0 then writeln ("NO" ) else writeln (minDigit) end .

vAR N, DIGIT, MINDIGIT: LONGINT; begin readln (n); Mindigit: \u003d N MOD 10; While N\u003e 0 Do Begin Digit: \u003d n MOD 10; If Digit MOD 2 \u003d 0 THEN IF DIGIT< minDigit then minDigit:= digit; N:= N div 10; end; if minDigit = 0 then writeln("NO") else writeln(minDigit) end.

Sequentially follow the following:
1. Write that this program will withdraw when entering the number 231 .
2. Give an example of such a three-digit number, when entering the program, despite errors, gives the right answer.
3. Find the errors allowed by the programmer and correct them. The error correction should affect only the string in which the error is located. For each error:

1) Write the line in which the error is made;
2) Specify how to fix the error, i.e. Give the correct line option.

It is known that in the text of the program you can fix exactly two lines so that it will work correctly.

Demals 25 tasks. Demo version of the EGE on computer science 2019 (FIPI):

An integer array is given 30 Elements. The elements of the array can take natural values \u200b\u200bfrom 1 before 10 000 inclusive. Describe the algorithm on one of the programming languages \u200b\u200bthat finds minimum among the elements of the array, not Fucked by Naljelo on 6 And then replaces each element that does not focus on 6, the number equal to the found minimum. It is guaranteed that at least one such an element in the array is. As a result, it is necessary to display a changed array, each element is displayed from a new line.

For example, for the source array of six elements:

14 6 11 18 9 24

the program must bring the following array.

9 6 9 18 9 24

The source data is declared as shown below. It is forbidden to use the variables that are not described below, but it is allowed not to use some of the variable described.

Pascal: Python:
const n \u003d 30; VAR A: Array [1 .. N] of Longint; I, J, K: LONGINT; begin for i: \u003d 1 to n do readln (a [i]); ... end.

const n \u003d 30; VAR A: Array of Longint; I, J, K: LONGINT; begin for i: \u003d 1 to n do readln (a [i]); ... end.

# It is also allowed to use two # integer variables J and k a \u003d n \u003d 30 for i in Range (0, N): a.append (int (input ())) ...

C ++:
#Include. Using Namespace STD; const int n \u003d 30; int main () (Long A [n]; long i, j, k; for (i \u003d 0; i< N; i++ ) cin >\u003e A [i]; ... Return 0; )

#Include. Using Namespace STD; const int n \u003d 30; int main () (Long A [n]; long i, j, k; for (i \u003d 0; i< N; i++) cin >\u003e A [I]; ... Return 0; )

  • Demals 26 tasks. Demo version of the EGE on computer science 2019 (FIPI):

    Two players, Petya and Vanya, play the next game. Before players lie two piles of stones. Players walk in turn, the first move does Peter. In one move, the player can add to one of the coup (by his choice) one stone or increase the number of stones in a pile three times.

    For example, even in one heap 10 stones, and in another 7 stones; This position in the game will be denoted (10, 7). Then, in one move, you can get any of the four positions: (11, 7), (30, 7), (10, 8), (10, 21).

    In order to make moves, each player has an unlimited number of stones.
    The game is completed at the moment when the total number of stones in the piles becomes not less than 68.. The winner is the player who has made the last move. The first one received such a position at which there will be 68 or more stones in a heap.
    At the initial moment in the first heap there were six stones, in the second heap - s stones; 1 ≤ s ≤ 61.

    We will say that the player has a winning strategy if he can win with any enemy's moves. Describe the player's strategy - it means to describe what move he should do in any situation that he can meet with a different enemy game. The description of the winning strategy should not include the moves of the player's strategy, which are not definitely advantageous for him, i.e. Not winning, regardless of the opponent game.

    Perform the following tasks:

    Exercise 1
    but) Specify all such numbers S.in which Petya can win in one move.
    b) It is known that Vanya won his first move after the unsuccessful first move of Petit. Specify the minimum value S.When this situation is possible.

    Task 2.
    Specify this value S.In which the Petit has a winning strategy, and at the same time two conditions are performed:
    Petya cannot win in one move;
    Petya can win by its second move regardless of how Vanya will walk.
    For the specified value s, describe the Petit winning strategy.

    Task 3.
    Specify the value S, at which two conditions are simultaneously being performed:
    Vanya has a winning strategy that allows him to win the first or second progress with any Petit game;
    Vani has no strategy that will allow him to be guaranteed to win first move.
    For the specified value S. Describe Vanya winning strategy.

    Build a tree of all parties, possible with this winning vanity strategy (in the form of a picture or table). In the nodes of the tree, specify positions, it is recommended to specify moves on the rails. The tree should not contain parties, impossible when implementing the winning player of its winning strategy. For example, a complete game of the game is not the right answer to this task.

    Demals 27 tasks. Demo version of the EGE on computer science 2019 (FIPI):

    The program input comes to a sequence from N whole positive numbers, all numbers in sequences are different. All pairs of various elements of the sequence are considered,
    located at a distance of no less than 4 (The difference in the indexes of the elements of the pair should be 4 or more, the order of elements in the pair is notable).
    It is necessary to determine the number of such steam for which the product of the elements is divided into 29.

    Description of input and output:
    The first line of the input data sets the number of N numbers ( 4 ≤ n ≤ 1000). In each of the subsequent n strings, one integer positive number is recorded that does not exceed 10 000 .
    As a result, the program should output one number: the number of pairs of elements in the sequence at a distance of at least 4, in which the product of the elements is multiple 29.

    An example of input data:

    7 58 2 3 5 4 1 29

    An example of output for the input data above:

    Of the 7 given elements, taking into account the permissible distances between them, it is possible to make 6 works: 58 · 4 \u003d 232: 29 \u003d 8 58 · 1 \u003d 58: 29 \u003d 2 58 · 29 \u003d 1682: 29 \u003d 58 2 · 1 \u003d 2 2 · 29 \u003d 58: 29 \u003d 2 3 · 29 \u003d 87: 29 \u003d 3

    Of these, 5 products are divided into 29.

    It is required to write an effective time and memory program to solve the described task.

    -\u003e demo version ege 2019

    Changes in KIM EGE 2020 in computer science and ICT.

    The examination work consists of two parts, including 27 tasks.

    • Part 1 Contains 23 tasks with a brief response. Answers to Jobs 1-23 are written in the form of a number, sequence of letters or numbers.
    • Part 2 Contains 4 tasks with an expanded response. Tasks 24-27 require an expanded solution.

    All the forms of the EE are filled with bright black ink. It is allowed to use gel or capillary handle. When performing tasks, you can use the draft. Records in Chernovik, as well as in the text of control measuring materials are not taken into account when evaluating work.

    The execution of the examination work on computer science and ICT is given for 3 hours 55 minutes (235 minutes).

    The points you received for completed tasks are summed up. Try to perform as much tasks as possible and score the largest number of points.

    Scores for computer scores

    1 point - for 1-23 tasks
    2 points - 25.
    B point - 24, 26.
    4 points - 27.

    Total: 35 points.

    Demo version of the EGE on computer science for grade grade 2004 - 2014 consisted of three parts. The first part included tasks in which you need to choose one of the suggested answers. The tasks from the second part required a brief answer. Tasks from the third part needed to give a detailed answer.

    In 2013 and 2014 in demonstration Options EGE on computer sciencethe following were made change:

    • was in the second part of the work.

    In 2015 in demonstration version on computer science was modified and optimized the structure of the option generally:

      Option became consist of two parts (part 1 - jobs with a brief answer, part 2 - ).

      Numbering The tasks began through All over the option without alphabetic designations A, B, C.

      Was Changed the response recording form in tasks with a response choice:the answer has become necessary to record the number with the correct answer number (and not to mark the cross).

      It was Reduced total number of tasks (from 32 to 27); It was reduced from 40 to 35 Maximum quantity Primary points.

      Reducing the number of tasks is made at the expense enlarging the subjects of tasksInformation close on the subject and complexity of tasks in one position. Such enlarged Positions: №3 (storage of information in a computer), No. 6 (formal execution of algorithms), No. 7 (technology of calculation and visualization of data using spreadsheets) and No. 9 (speed of sound and graphic files). IN demonstration of 2015 represented some examples of each of the tasks 3, 6, 7 and 9. In real versions It was proposed for each of these positions. only one the task.

    • Was changed the task sequence.
    • That part of the work that contained tasks with a detailed answer, not changed.

    IN demonstration version of the 2016 computer scam Compared to the 2015 Demonstration Option on Informatics there are no significant changes: Only the sequence of tasks 1-5 is changed.

    IN demonstration Options of the 2017 Informationcompared to the 2016 Demonstration Option on Informatics there were no changes.

    IN demo version of the 2018 Year of Informatics Compared to the demonstration option of 2017, the following were made on computer science. Changes:

      In task 25. removed opportunity writing algorithm in natural language,

    • Examples texts of programs and their fragments in the terms of the tasks 8, 11, 19, 20, 21, 24, 25 in the C language, replaced with examples in C ++.

    IN demo emes 2019-2020 by computer science Compared to the 2018 Demonstration Option for Informatics there were no changes.

    Secondary education

    Computer science

    DEVEROVIY EGE-2019 on computer science and ICT

    We bring to your attention the analysis of the demo 2019 of 2019 on computer science and ICT. This material contains explanations and a detailed solution algorithm, as well as recommendations on the use of reference books and benefits that may be needed when preparing for the USE.

    You can download the demo information on computer science for graduates 2019 by reference below:

    Read about innovations in the examination options for other subjects, read in.

    The manual contains tasks as close as possible to the real used on the exam, but distributed by themes in the order of their study in the 10-11 grades of the older school. Working with a book, you can consistently work out every topic, eliminate gaps in knowledge, as well as systematize the material studied. Such a structure of the book will help more effectively prepare for the exam.


    Demo-Kim Ege 2019 on computer science, has not undergone any changes in its structure compared to 2018. This significantly simplifies the work of the teacher and, of course, already built (I want to count on it) a plan for preparing for the examination exam.

    In this article, we will consider the decision of the proposed project (at the time of writing an article still projects) Kim Ege on computer science.

    Part 1

    Answers to Jobs 1-23 are the number, a sequence of letters or numbers that should be recorded in the response form No. 1 to the right of the number of the corresponding task, starting with the first cell, without spaces, commas and other additional characters. Each character is written in a separate cell in accordance with the samples given in the form.

    Exercise 1

    Calculate the value of expression 9E 16 - 94 16.

    In response, write down the calculated value in the decimal number system.

    Decision

    Simple arithmetic in a hexadecimal number system:

    Obviously, the hexadecimal figure E 16 corresponds to a decimal value of 14. The difference in the initial numbers gives the value of 16. The decision in principle was already found. By following the condition, imagine the solution found in a decimal number system. We have: A 16 \u003d 10 10.

    Answer: 10.

    Task 2.

    Misha filled the truth table (¬x / \\ ¬ ¬y) \\ / (y≡z) \\ / ¬W, but managed to fill only a fragment of three different lines, even without specifying, which column of the table corresponds to each of the variables W, X , y, z.

    Determine which column of the table corresponds to each of the variables W, X, Y, Z.

    In response, write the letters w, x, y, z in the order in which the columns corresponding to them (first the letter corresponding to the first column; then the letter corresponding to the second column, etc.). Letters in response write in a row, no separators between letters do not need.

    Example. If the function was set by an expression ¬x \\ / y, depending on two variables, and the table fragment would have a view

    the first column would correspond to the variable Y, and the second column - the variable x. The answer should be written yx.

    Answer: ___________________________.

    Decision

    Let's notify that the function (¬x / \\ ¬y) \\ / (y≡z) \\ / ¬W is essentially disjunction of the three "components":

    Remember the truth table of the operation of logical "addition" (disjunction): in the sum of "truth", if at least one term "truth", and "lie", if both are "false". It means that we conclude from the terms of the task that each of the components should be false. The third term is (¬W) - it must be false, which gives us the first hook: the fourth column must be a variable W, since, based on the values \u200b\u200bof the first, second and third columns, none of them can be a variable w.

    Consider the second term function - (y≡z) - it should also be equal to 0. Therefore, it is necessary that in our columns of the variables y and z were different values. Taking into account the first term function (¬x / \\ ¬ ¬y), we note that the variable z corresponds to the first column. The first term indicates that in the empty cells of the second and third columns should be 1. Immediately, taking into account the second term, we will make another conclusion that an empty cell in the first column is 1. It is this conclusion that allows us to make the final The conclusion that the second column corresponds to the variable y, and, accordingly, the third variable x.

    Answer: zyxw.

    Task 3.

    The figure below shows the scheme of the roads of the n-district area, in the table as a star designated the presence of the road from one local location to another. The absence of the stars means that there is no way.


    Each settlement in the scheme corresponds to its number in the table, but it is unknown, which number. Determine which rooms of settlements in the table can correspond to settlements B and C in the scheme. In response, write down these two numbers in the increasing order without spaces and punctuation signs.

    Answer: ___________________________.

    Decision

    The scheme shows that each of the points B and C is connected to three other items. It means that we need to find those in city items in the table, opposite which three "stars" are in directions (or in columns, taking into account symmetry). This condition corresponds to strings 2 and 6 (respectively columns 2 and 6).

    Answer: 26.

    Task 4.

    Below are two fragments of tables from the database on the inhabitants of the microdistrict. Each line of Table 2 contains information about the child and about one of his parents. The information is represented by the value of the ID field in the appropriate line of the table 1. On the basis of the given data, determine the greatest difference between the years of birth of native sisters. When calculating the response, consider only information from the above table fragments.


    Answer: ___________________________.

    Decision

    The first thing that is worth paying attention is not to get confused - we exclude male representatives (more precisely, we do not take into account when calculating children-girls): These are strings 64, 67, 70, 75, 77, 86 tables 1.

    Passing through the fields of tables, we find a pair of children girls:

    Year of birth

    Year of birth

    The difference between the year

    In response, we entered the largest of the two differences between the year of birth.

    Answer: 6.

    Task 5.

    To encode some sequence consisting of letters A, B, B, G, D, E, decided to use an uneven binary code that satisfies the Fano condition. For the letter A used code word 0; For the letter B - code word 10. What is the smallest possible amount of code words for letters in, g, d, e?

    Note. The Fano Condition means that no code word is the beginning of another code word. This provides the ability to unambiguously decrypt encoded messages.

    Answer: ___________________________.

    Decision

    To solve the task, we construct a graph:


    The code word of length 2-11, or any of the code words of length 3, inevitably becomes the beginning of one of the words of length 4. The choice of length 4 is associated with the fact that there was a need for coding four letters. The obtained code words in the aggregate give length 16.

    Answer: 16.

    Task 6.

    The input of the algorithm is given by the natural number N. The algorithm builds the new number R on it as follows.

    1. A binary recording of N. has been built.
    2. On the right of the next rule add to this entry: if n is read, at the end of the number (right), the zero is added first, and then the unit. Otherwise, if N is odd, the unit finishes first, and then zero.

    For example, a binary recording of 100 numbers 4 will be converted to 10001, and the binary entry 111 of the number 7 will be converted to 11110.

    The record thus obtained (in it by two discharges is greater than in the recording of the initial number N) is a binary entry of the number R - the result of the operation of this algorithm.

    Specify the minimum number R, which is greater than 102 and may be the result of the operation of this algorithm. In response, write this number in the decimal number system.

    Answer: ___________________________.

    Decision

    Imagine the number 102 in binary form: 1100110 2. We are interested in the number that will be more. We will move "up" by adding one by one:

    1100111 2 - 103 10 - binary representation does not correspond to the algorithm;

    1101000 2 - 104 10 - binary representation does not correspond to the algorithm;

    1101001 2 - 105 10 - binary representation corresponds to the algorithm.

    Answer: 105.

    Task 7.

    Dan fragment of the spreadsheet. From the C3 cell in the D4 cell was copied formula. When copying the address of the cells in the formula, they have changed automatically. What was the numerical value of the formula in the D4 cell?


    Note. The $ sign indicates an absolute addressing.

    Answer: ___________________________.

    Decision

    When copying the formula in the D4 cell, we obtain: \u003d $ B $ 3 + E3. Substitting the value we get the desired result:

    400 + 700, i.e. 1100.

    Answer: 1100.

    Task 8.

    Record the number that will be printed as a result of the following program. For your convenience, the program is presented in five programming languages.


    Answer: ___________________________.

    Decision

    Let us be asked for changes in variable values:

    s \u003d 0, n \u003d 75 - values \u200b\u200bbefore cycle;

    s + N (75)< 150, s = s + 15 = 15, n = n – 5 = 70 – значения после первой итерации;

    s + N (85)< 150, s = s + 15 = 30, n = n – 5 = 65 – значения после 2 итерации;

    s + N (95)< 150, s = s + 15 = 45, n = n – 5 = 60 – значения после 3 итерации;

    s + N (105)< 150, s = s + 15 = 60, n = n – 5 = 55 – значения после 4 итерации;

    s + N (115)< 150, s = s + 15 = 75, n = n – 5 = 50 – значения после 5 итерации;

    s + N (125)< 150, s = s + 15 = 90, n = n – 5 = 45 – значения после 6 итерации;

    s + N (135)< 150, s = s + 15 = 105, n = n – 5 = 40 – значения после 7 итерации;

    s + N (145)< 150, s = s + 15 = 120, n = n – 5 = 35 – значения после 8 итерации;

    the cycle in the next step is interrupted, the program displays the desired value.

    Answer: 35.

    Task 9.

    Automatic camera produces raster images with a size of 200 × 256 pixels. To coding the color of each pixel, the same amount of bits are used, pixel codes are written to the file one by one without intervals. The scope of the image file cannot exceed 65 Kbytes without checking the size of the file header. What is the maximum number of colors can be used in the palette?

    Answer: ___________________________.

    Decision

    To start some simple calculations:

    200 × 256 - the number of raster image pixels;

    65 KB \u003d 65 × 2 10 × 2 3 BIT - upper file volume threshold.

    The ratio to will allow us to get the depth of the pixel color, i.e. The number of bits that is discharged to color coding for each pixel.

    And finally, the desired value that we define the classical formula:

    2 I. = n., 2 10 .

    Answer: 1024.

    Task 10.

    Vasya is 5-letter words in which there are only letters s, and, m, and, and in each word there is exactly one vowel letter and it meets exactly 1 time. Each of the permissible consonants can occur in the word Any number of times or not to meet at all. A word is considered to be any permissible sequence of letters, not necessarily meaningful. How many words that you can write vasya?

    Answer: ___________________________.

    Decision

    If it were not for the condition "there is exactly one vowel letter and it meets exactly 1 time," the task would be solved quite simply. But there is this condition, and there are two different vowels.

    This vowel can be at one out of 5 positions. Suppose she is in the first position. Possible variants of vowels in this case in this position is exactly 2. On the other four positions, we have two options for consonants. Total options for the first case:

    2 × 2 × 2 × 2 × 2 \u003d 2 5 \u003d 32

    Total options for the location of the vowel letter in our word, I repeat, exactly 5. TOTAL:

    Answer: 160.

    Task 11.

    The recursive algorithm F is recorded below in five programming languages.


    Write down in a row without spaces and separators all the numbers that will be printed on the screen when performing a call F (4). Numbers must be recorded in the same order in which they are displayed on the screen.

    Answer: ___________________________.

    Decision

    For clarity, we build a tree:


    Moving along this tree of recursion we get a value that will be the desired solution.

    Answer: 1231412.

    Task 12.

    In the TCP / IP network terminology, a binary number is called a binary number that determines which part of the network node IP address refers to the network address, and which is to the address of the node itself in this network. Typically, the mask is recorded according to the same rules as the IP address, - in the form of four bytes, and each byte is written in the form of a decimal number. At the same time, in the mask, first (in the older discharges) cost units, and then from some discharge - zeros. The network address is obtained as a result of the use of the bonnetic conjunction to the specified node IP address and mask.

    For example, if the IP address of the node is 231.32.255.131, and the mask is 255.255.240.0, the address of the network is equal to 231.32.240.0.

    For a node with an IP address 117.191.37.84 Network address is 117.191.37.80. What is the least possible value of the latter (right) byte masks? Answer write in the form of a decimal number.

    Answer: ___________________________.

    Decision

    We write down the binary representation of the last right byte of the IP address, the network addresses and masks in accordance with the definition (in the top line for convenience, the bits are numbered):

    Mask -?

    Network address

    We will move right to left, substituting the bits in the mask. At the same time, we take into account that we in the mask "first (in the older discharges) there are units, and then from some discharge - zeros."

    Starting from the 0th bit (right to left), we will select the values \u200b\u200bof the network mask, taking into account the biddling conjunction:

    Mask -?

    Network address

    In the 4th bit, it is obvious that the zero value is no longer suitable and there must be 1 (one). Starting with this position and then moving to the left, we will stand all units:

    Mask -?

    Network address

    The desired value of the extreme right byte is 111100002, which corresponds to the value of 24010 in a decimal number system.

    Answer: 240.

    Task 13.

    When registering in a computer system, each user is issued a password consisting of 7 characters and contains only symbols from a 26-character set of capital Latin letters. In the database to store information about each user, the same and the minimum possible integer byte is assigned. In this case, the inventive coding of passwords is used, all symbols are encoded the same and minimally possible amount of bits. In addition to the password itself, for each user in the system, more information is stored, for which a whole number of bytes is allocated; This number is the same for all users.

    To store information about 30 users it took 600 bytes. How much byte is allocated for storing additional information about one user? In response, write down only an integer - the number of bytes.

    Answer: ___________________________.

    Decision

    The storage of information of each user is assigned

    600 ÷ 30 \u003d 20 bytes.

    The encoding 26 characters requires a minimum of 5 memory bits. Therefore, the password of 7 characters is required

    5 × 7 \u003d 35 bits.

    35 bits requires a minimum of a total of 5 bytes of memory.

    The desired number of bytes for storing additional information about one user is:

    20 byte - 5 bytes \u003d 15 bytes.

    Answer: 15.

    Task 14.

    Artist editor receives a number of numbers on the line and transforms it. The editor can execute two commands, in both commands V and W denote the chains of numbers.

    A) Replace (V, W).

    This command replaces the first on the left of the entry of the chain V to the chain w. For example, execution of the command

    replace (111, 27)

    converts a string of 05111150 to a string of 0527150.

    If the row does not have the entries of the chain V, then the execution of the command to replace (V, W) does not change this string.

    B) Found (V).

    This command checks whether the V is encountered in the artist string editor. If it meets, the command returns the logical value "Truth", otherwise returns the value "Lie". The string of the artist does not change.

    So far

    sequence of commands

    End of

    performed until the condition is true.

    In the design

    If condition

    Then team1

    End if

    command1 (if the condition is truly).

    In the design

    If condition

    Then team1

    Otherwise, team2

    End if

    command1 (if the condition is truly) or command2 (if the condition is false).

    Which line will be as a result of applying the program below to a string consisting of 82 consecutive digits 1? In response, write down the resulting string.

    While there was (11111) or found (888)

    If found (11111)

    Then replace (11111, 88)

    If found (888)

    Then replace (888, 8)

    End if

    End if

    End of

    Answer: ___________________________.

    Decision

    "We visualize" the situation:


    82 units can be conventionally represented as 16 groups of 5 units, as well as one group of two units. The first challenge call is given to us 16 groups of eight pairs are 32 eight or 10 groups of three eights, as well as another free eight steam. It is obvious that the last two units will remain not affected by the Contractor. A 12 The remaining eights grouped by three are already 4 eights. Another iteration - 2 eights remain and 2 units.

    Answer: 8811.

    Task 15.

    The figure shows a scheme of roads connecting cities A, B, B, G, D, E, F, Z, and, K, L, M. On each road can only be moved in the same direction indicated by the arrow.

    How many different ways are there from the city and in the city of m passing through the city l?


    Answer: ___________________________.

    Decision


    Consider our scheme again. This time in the diagram we see the labels located in a certain order.

    To begin with, we note that the paths from the point and to the point M is straight and through the point K - are highlighted by color. This is done because by the condition of the task it is necessary to determine the number of paths only through the point L.

    Let's start from the start point A is a special point, there is no way there is no road, formally can only be accessed from it. We put that the number of ways to it is equal to 1.

    The second point B is obvious that only one point can be accessed into it and only one way. There can be no third point in any r - the number of paths to the point in can not be determined without determining the number of paths in r, and in G - without determining the number of paths in D. d - the third point on our path. The number of paths that lead to it is equal to 1. We will continue this chain of conclusions, defining the number of paths leading to this point as the sum of the paths in the previous points leading directly to the current. Point and - critical point - the number of paths leading to it equal to the amount of 5 (e) +16 (g) +7 (s) and equal to 28. The next point - l, the road leads only through and, there is no other path, and Consequently, the number of paths also remains equal to 28. And, finally, the point-finish is M - only one road leads to the condition of the problem, which means the desired value will also remain equal to 28.

    Answer: 28.

    Task 16.

    The value of the arithmetic expression 9 7 + 3 21 - 9 was recorded in the number system with a base 3. How many digits "2" contains in this record?

    Answer: ___________________________.

    To solve the task, rewrite the original expression, as well as perform the permutations of the terms:

    3 21 + 3 14 – 3 2 .

    Recall that in the Tropic Number System, the number 3 10 is written 10 3. K.- I am the degree of number 10 n. essence of 1 I. K. zeros. And it is also obvious that the first term 3 21 in no way affects the number of bobs. But the difference can affect.

    Answer: 12.

    Task 17.

    In the search server requests for the logical operation "or", the "|" symbol is used, and for the designation of the logical operation "and" - the "&" symbol.

    The table shows the requests and the number of pages found on them some segment of the Internet.


    How many pages (in hundreds of thousands) will be found on request Throat | Ship | Nose? It is believed that all requests were performed almost simultaneously, so that the set of pages containing all the desired words did not change during the execution of requests.

    Answer: ___________________________.

    Decision

    Of course, the operation or indicates the operation of the addition of the values \u200b\u200bof the found pages for each word separately: 35 + 35 + 40. But on some requests were pages common for each of the words of words - they need to be excluded, i.e. It is necessary to subtract 33 from the amount found earlier.

    Answer: 77.

    Task 18.

    For what the greatest integer non-negative number and the expression

    (48 ≠ y + 2x) \\ / (a< x) \/ (A < y)

    identically true, i.e. Takes value 1 for any whole non-negative X and Y?

    Answer: ___________________________.

    Decision

    The task is purely mathematical ...

    This in the condition of the task is the expression of the essence of the disjunction of the three terms. The second and third terms are dependent on the desired parameter:

    Imagine the first term otherwise:

    y. = –2x.+ 48

    The direct points (graphics of the function) with integer coordinates are those values \u200b\u200bof the variables X and Y, in which it ceases to be true. Therefore, we need to find such a, which in these points would ensure truth or.

    Or with different x and y, owned by direct, will be alternately (sometimes at the same time) to make a true meaning for anyone in the range. In this regard, it is important to understand what should be the parameter and for the case when y. = x..

    Those. We get the system:


    The solution to find is easy: y \u003d x \u003d 16. And the greatest integer that is suitable for us for the parameter A \u003d 15.

    Answer: 15.

    Task 19.

    The program uses a one-dimensional integer array A with indexes from 0 to 9. The values \u200b\u200bof the elements are 2, 4, 3, 6, 3, 7, 8, 2, 9, 1, accordingly, i.e. A \u003d 2, a \u003d 4, etc. Determine the value of the variable c. After performing the next fragment of this program, recorded below in five programming languages.


    Answer: ___________________________.

    Decision

    The fragment of the program executes the repetition cycle. The number of iterations is 9. Every time the condition is fulfilled. from Increases its value to 1, and also changes the values \u200b\u200bof the two elements of the array in places.

    Source sequence: 2, 4, 3, 6, 3, 7, 8, 2, 9, 1. You can build the following iteration scheme in the record:

    Iteration step:

    Checking condition

    After replacement

    Variable from

    2<2 – НЕТ

    2<1 – НЕТ

    Answer: 7.

    Task 20.

    The algorithm is recorded below five programming languages. Having received a natural decimal number x on an input, this algorithm prints two numbers: L and M. Specify the largest number X, when entering which the algorithm prints first 21, and then 3.




    Answer: ___________________________.

    Decision

    Some code analysis:

    1. We must output the values \u200b\u200bof the variables L and M. The variable M, this can be seen by studying the code, indicates the number of iterations of the cycle, i.e. The cycle body must be completed three times smoothly.
    2. The value of the number L, which must be displayed first, the product, equal to 21. It is possible to obtain in the work 21 from 7 and 3. We also note that the work is possible only with an odd value of the variable x. in current iteration.
    3. The condition operator indicates that once of the three value of the variable will be even. In the remaining twice with an odd value of the variable x., We get the residue from dividing x to 8 will be equal to once 3, and another 7.
    4. Variable value x. It decreases three times 8 times the operation of integer division.

    By connecting everything previously said, we get two options:

    x.1 \u003d (7 × 8 +?) × 8 + 3 and x.2 \u003d (3 × 8 +?) × 8 + 7

    Instead of the sign of the question, we need to choose a value that will be no more than 8 and will be even. I will not even forget about the condition in the task - "the largest x". Larger even, not exceeding 8 - 6. And from x1 and x2, it is obvious that the first is greater. Calculation, we get x \u003d 499.

    Answer: 499.

    Task 21.

    Determine the number that will be printed as a result of the implementation of the next algorithm. For your convenience, the algorithm is presented in five programming languages.

    Note. The ABS and IABS functions return the absolute value of their input parameter.






    Answer: ___________________________.

    Decision

    We write our function in the usual form:

    For clarity paintings, we also build a graph of this feature:


    Looking at the code, we note the following obvious facts: until the cycle is executed, the variable M \u003d -20 and R \u003d 26.

    Now the cycle itself: twenty one iteration, each depends on the execution (or non-compliance) conditions. Check all values \u200b\u200bThere is no need - the schedule will help us very much here. Moving from left to right The values \u200b\u200bwill be variables M and R will change until the first point of minimum will be achieved: x \u003d -8. Next and to the point x \u003d 8, the validation of the condition gives false values \u200b\u200band the values \u200b\u200bof the variables does not change. At point x \u003d 8, there is a change in the values \u200b\u200bfor the last time. We obtain the desired result m \u003d 8, r \u003d 2, m + r \u003d 10.

    Answer: 10.

    Task 22.

    Contractor The calculator converts the number written on the screen. The artist has three teams that are assigned rooms:

    1. Add 2.
    2. Multiply to 2.
    3. Add 3.

    The first of them increases the number on the screen by 2, the second multiplies it to 2, the third increases it to 3.

    The computer program is a sequence of commands.

    How many of these programs that convert the source number 2 to the number 22 and the path of the program calculation contains the number 11?

    The trajectory of the program calculation is the sequence of the results of the execution of all program commands. For example, for the program 123, with the source number 7, the trajectory will consist of numbers 9, 18, 21.

    Answer: ___________________________.

    Decision

    To begin with, we will simply solve the task, without taking into account the additional condition "contains the number 11":


    The program is short, as well as it does not give in its trajectory to calculate the value of 11. And here it is worth breaking the task into two small tasks: to determine the number of paths from 2 to 11 and from 11 to 22. The final result will obviously correspond to the product of these two values. Building complex patterns with trees is not a rational spending time on the exam. Numbers in our range are not so much, so I propose to consider the following algorithm:

    Drink all the numbers from the start and to the last inclusive. Under the first you will write 1. Moving from left to right, consider the number of ways to enter the current position using the data of us commands.


    Immediately you can remove obvious positions that do not affect the solution: 3 can be shocked - it is clear that it is impossible to get from the starting position using one of the teams available to us; 10 - Through it, we can not get into our intermediate, and most importantly, a binding position 11.

    In 4, we can get two ways to commands: x2 and +2, i.e. After 4 pass 2 ways. Write this value under 4. In 5, it is possible to get the only way: +3. We write under 5 Valid 1. In 6, it is possible to get the only way - after 4. And under it, we are indicated. The value 2. Accordingly, it is precisely two of these ways by passing 4. We will come from 2 to 6. We write under 6 Value 2. in 7 Get out of the two previous positions using the commands we have, and to get the number of paths that are available to us for entering 7, we will form the numbers that indicated under these previous positions. Those. In 7, we fall 2 (from under 4) + 1 (from-under 5) \u003d 3 ways. Acting on this scheme and then we get:


    We turn to the right half of the conditional center - 11. Only now, when calculating, we will consider only the paths that pass through this center.


    Answer: 100.

    Task 23.

    How many different sets of logical variables x1, x2, ... x7, y1, y2, ... x7, y1, y2, ... y7, which satisfy all the conditions listed below?

    (Y1 → (Y2 / \\ x1)) / \\ (x1 → x2) \u003d 1

    (Y2 → (Y3 / \\ x2)) / \\ (x2 → x3) \u003d 1

    (Y6 → (Y7 / \\ x6)) / \\ (x6 → x7) \u003d 1

    In response, you do not need to list all different sets of values \u200b\u200bof variables x1, x2, ... x7, y1, y2, ... x7, y1, y2, ... y7, under which this system of equalities is made. As an answer, you need to specify the number of such sets.

    Answer: ___________________________.

    Decision

    A rather detailed analysis of this category of tasks was published in its time in the article "Systems of Logic Equations: Solution with the help of bit chains."

    And for further reasoning, we will recall (for clarity, we will write down some definitions and properties:

    Let's look at our system again. We note that it can be rewritten a little different. For this, first of all, we note that each of the selected multipliers in the first six equations, as well as their mutual work is equal to 1.


    We will work a little over the first factors of the equations in the system:


    Taking into account the above considerations, we obtain two more equations, and the initial system of equations will take the form:

    In this form, the source system is reduced to typical tasks discussed in the article specified earlier.

    If you consider the first and second equation of the new system separately, then the sets correspond to them (let it provide a detailed analysis of this output to leave for the reader):


    These arguments would lead us to a possible 8 × 8 \u003d 64 solution options if it were not for the third equation. In the third equation, we can immediately restrict ourselves to considering only those options for sets that are suitable for the first two equations. If we substitute the first set in the third equation y.1…y.7, consisting only of 1, it is obvious that only one set will correspond to him x.1…x.7, which also consists only of 1. Any other set in which there is at least one 0, it does not fit us. Consider the second set Y1 ... Y7 - 0111111. For x.1 are allowed both possible variants of values \u200b\u200b- 0 and 1. The remaining values, as in the previous case, cannot be equal to 0. sets that correspond to this condition we have two. The third set of Y1 ... Y7 - 011111 will be approached by the first three sets. x.1…x.7. etc arguing similarly, we get the desired number of sets equal

    1 + 2 + … + 7 + 8 = 36.

    Answer: 36.

    Part 2

    To record responses to the tasks of this part (24-27), use the answer form No. 2. Record first task number (24, 25, etc.), and then a complete solution. Records write out clearly and picking up.

    Next, we do not see the need to come up with something different from the official content of Kim's demo version. This document also carries the "content of the right answer and assessment guidelines", as well as "instructions for assessment" and some "notes for the expert". This material is also given later.

    Task 24.

    The processing comes with a natural number, not exceeding 109. You need to write a program that displays the minimum reader of this number to the screen. If there are no read numbers, it is required to display "NO". The programmer wrote the program incorrectly. Below, this program is provided for your convenience in five programming languages.




    Consistently follow the following.

    1. Write that this program will withdraw when entering the number 231.

    2. Give an example of such a three-digit number, with the introduction of which the given program, despite the errors, gives the right answer.

    3. Find the error programmer and correct them. The error correction should affect only the string in which the error is located. For each error:

    1. write the line in which the error is made;
    2. specify how to fix the error, i.e. Give the correct line option.

    It is known that in the text of the program you can fix exactly two lines so that it will work correctly.

    It is enough to specify errors and the way they are fixed for one programming language.

    Please note that you need to find errors in the existing program, and not write your own, perhaps using another solution algorithm.

    The solution uses the recording of the program on Pascal. It is allowed to use the program on any of the four other programming languages.

    1. The program will display the number 1.

    2. The program issues the correct answer, for example, for the number 132.

    Note for checking. The program works incorrectly due to incorrect initial initialization and incorrect verification of the absence of even digits. Accordingly, the program will produce a correct answer if the input number does not contain 0, contains at least one other digit and the smallest digit number of no longer than younger (extreme right) numbers (or just worth the last).

    3. The program has two errors.

    The first error: incorrect response initialization (Mindigit variable).

    String with an error:

    mindigit: \u003d N MOD 10;

    Faithful fix:

    Instead of 10, any integer, more than 8 can be used.

    Second error: incorrect checking of the absence of reader numbers.

    String with an error:

    if Mindigit \u003d 0 Then

    Faithful fix:

    if Mindigit \u003d 10 Then

    Instead of 10, there may be another number, more than 8, which was put in the Mindigit when correcting the first error, or verify that Mindigit\u003e 8

    Assessment guidelines

    Point

    Note! The task required four steps:

    1) indicate that the program will withdraw at a particular entrance number;

    2) specify an example of an input number in which the program issues the right answer;

    3) fix the first error;

    4) Fix the second error.

    To verify the execution of paragraph 2), you need to formally perform the original (erroneous) program with the input data that specified the examiner, and make sure that the result issued by the program will be the same as for the correct program.

    For action 3) and 4) an error is considered corrected if both of the following conditions are followed:

    a) the correctly indicated string with an error;

    b) such a new version of the line is specified that when correcting another error it turns out the correct program

    All four necessary actions are performed, and no faithful line is specified as an erroneous

    There are no conditions allowing to put 3 points. There is one of the following situations:

    a) three of the four necessary actions are made. No correct row is indicated as erroneous;

    b) all four necessary steps are made. Indicated as an erroneous no more than one right line

    The conditions that allow you to put 2 or 3 points are not fulfilled. Made two of the four necessary actions.

    No conditions allowed to put 1, 2 or 3 points

    Task 25.

    An integer array of 30 elements is given. The elements of the array can take natural values \u200b\u200bfrom 1 to 10,000 inclusive. Describe the algorithm in one of the programming languages, which finds a minimum among the elements of an array that do not focus on 6, and then replaces each element that does not focus on 6, the number equal to the minimum one. It is guaranteed that at least one such an element in the array is. As a result, it is necessary to display a changed array, each element is displayed from a new line.

    For example, for the source array of six elements:

    the program must bring the following array.

    The source data is declared as shown below on examples for some programming languages. It is forbidden to use the variables that are not described below, but it is allowed not to use some of the variable described.




    As an answer, you need to bring a fragment of a program that should be at the point of dots. You can also write a solution in another programming language (specify the name and used version of the programming language, such as Free Pascal 2.6). In this case, you must use the same source data and variables that were proposed in the condition (for example, in the sample written on the algorithmic language).

    In Pascal language


    In Python


    In the language of Baysik


    In C ++


    On an algorithmic language


    Assessment guidelines

    Point

    General instructions.

    1. In the algorithm recorded in the programming language, it is allowed to have separate syntactic errors that do not distort ideas the author of the program.

    2. The effectiveness of the algorithm does not matter and is not evaluated.

    3. It is allowed to record a programming language, different from the languages \u200b\u200bgiven in the Term. In this case, variables similar to those described in the condition should be used. If the programming language uses typed variables, the descriptions of the variables should be similar to the descriptions of the variables on the algorithmic language. The use of non-nipized or undeclared variables is possible only if this is allowed by the programming language; In this case, the number of variables and their identifiers must comply with the condition of the problem.

    4. An array output format is allowed, different from the specified, for example, in a line

    Proposed the correct algorithm that changes the source array and displays a changed array as a result

    conditions allowed to put 2 points. At the same time, the right solution is proposed in general, containing no more than one error from among the following:

    1) The cycle occurs abroad array;

    2) is not initialized or incorrectly initialized by a minimum;

    3) the value is incorrectly carried out by 6;

    4) the division is checked on 6 not an array element, but its index;

    5) in comparison with the minimum of the confused signs "more" and "less";

    6) Comparison with a minimum is made for an array element index, and not for its value;

    7) the logical condition is incorrectly compiled (for example, OR is used instead of and);

    8) The source array does not change;

    9) Not all required elements are changed (for example, only the first or last of them);

    10) There is no response output, or the answer is not completely output (for example, only one element of the array due to the missed output cycle of elements or operator brackets);

    11) the variable not declared in the variable descriptions section;

    12) not specified or incorrectly indicated the condition of completing the cycle;

    Errors listed in paragraph 1-13, two or more, or the algorithm is defined incorrectly (including in the absence of the search for the desired element in the apparent or implicit form)

    Maximum score

    Task 26.

    Two players, Petya and Vanya, play the next game. Before players lie two piles of stones. Players walk in turn, the first move is doing Petya. In one move, the player can add one stone to one of the coup (in its choice) or increase the number of stones in the heap three times. For example, even in one heap 10 stones, and in another 7 stones; This position in the game will be denoted (10, 7). Then in one move, you can get any of the four positions:

    (11, 7), (30, 7), (10, 8), (10, 21).

    In order to make moves, each player has an unlimited number of stones.

    The game is completed at the moment when the total number of stones in the piles becomes at least 68. The winner is the player who made the last move, i.e. The first one received such a position at which there will be 68 or more stones in a heap.

    At the initial moment in the first heap there were six stones, in the second heap - s stones; 1 ≤ S ≤ 61.

    We will say that the player has a winning strategy if he can win with any enemy's moves. Describe the player's strategy - it means to describe what move he should do in any situation that he can meet with a different enemy game. The description of the winning strategy should not include the moves of the player's strategy, which are not definitely advantageous for him, i.e. Not winning, regardless of the opponent game.

    Perform the following tasks.

    Exercise 1

    c) Specify all such values \u200b\u200bof the number S, in which Petya can win in one move.

    d) It is known that Vanya won his first move after the unsuccessful first move of Petit. Specify the minimum value of S when this situation is possible.

    Task 2.

    Specify such a value of S, in which the Petit has a winning strategy, and at the same time two conditions are performed:

    • Petya cannot win in one move;
    • Petya can win by its second move regardless of how Vanya will walk.

    For the specified value s, describe the Petit winning strategy.

    Task 3.

    Specify the value S, at which two conditions are simultaneously being performed:

    • vanya has a winning strategy that allows him to win the first or second progress with any Petit game;
    • vani has no strategy that will allow him to be guaranteed to win first move.

    For the specified value S, describe the winning Vani strategy.

    Build a tree of all parties, possible with this winning vanity strategy (in the form of a picture or table).

    In the nodes of the tree, specify positions, it is recommended to specify moves on the rails. The tree should not contain parties, impossible when implementing the winning player of its winning strategy. For example, a complete game of the game is not the right answer to this task.

    Exercise 1

    a) Peter can win at 21 ≤ s ≤ 61.

    Task 2.

    The possible value of S: 20. In this case, Petya, obviously, cannot win first. However, it can get a position (7, 20). After the progress of Vanya, one of the four positions may occur: (8, 20), (21, 20), (7, 21), (7, 60). In each of these positions, Petya can win in one move, tripling the number of stones in the second heap.

    Note for checking. Another possible value of S for this task is the number 13. In this case, Petya first move should triple the number of stones in a smaller heap and get a position (6 * 3, 13) \u003d (18, 13). With such a position, Vanya cannot win the first move, and after any move of Vani Petya can win, tripling the number of stones in a greater heap. It is enough to specify one value of S and describe the winning strategy for it.

    Task 3.

    The possible value of S: 19. After the first pedetch, positions are possible:
    (7, 19), (18, 19), (6, 20), (6, 57). In positions (18, 19) and (6, 57), Vanya can win the first move, tripling the number of stones in the second pile. From positions (7, 19) and (6, 20), Vanya can get a position (7, 20). This position is disassembled in paragraph 2. The player who received it (now it is Vanya), wins his second move.

    The table shows the tree of possible parties (and only them) with the described Vani strategy. Final positions (Vanya wins in them) are highlighted in bold. In the figure, the same tree is shown in graphical form (both ways of wood images are permissible).


    Note for an expert. The tree of all parties can also be depicted in the form of an oriented graph - as shown in the figure, or in another way. It is important that many full paths in the graph are in mutually uniquely compliant with a plurality of batches, possible with the strategy solution described in solving.


    Fig. 1. Tree of all parties, possible when vanisa strategy. Pethods are shown by dotted line; Vani moves are solid lines. The rectangle indicates the positions in which the party ends.

    Note for checking. It is not a mistake to specify only one final progress of the winning player in a situation when he has more than one winning stroke.

    Assessment guidelines

    Point

    The task requires three tasks. Their difficulty increases. The number of points as a whole corresponds to the number of tasks performed (see below).

    An error in the solution that does not distort the main idea and not leading to an incorrect answer, for example an arithmetic error when calculating the number of stones in the final position, when evaluating the decision is not taken into account.

    Task 1 is performed if both items are made: a) and b), i.e. For p. A) lists all values \u200b\u200bS that satisfy the condition (and only they), for p. b) is the correct value of S (and only it).

    Task 2 is performed if the position is correctly indicated for the Petita, and the corresponding petutal strategy is described - as it is done in the example example, or in another way, for example, with the help of a tree of all possible in the selected Petit Strategy (and only them).

    Task 3 is executed if the position is correctly indicated, and the tree is built by all possible when the parties strategy (and only them) are built.

    In all cases, strategies can be described as it is done in the example example, or in another way.

    Tasks 1, 2 and 3

    There are no conditions that allow you to put 3 points, and one of the following conditions is performed.

    1. Task 3.

    2. Tasks 1 and 2

    Conditions are not fulfilled to allow 3 or 2 points, and one of the following conditions is performed.

    1. Task 1.

    2. Task 2

    None of the conditions allowed to put 3, 2 or 1 score

    Task 27.

    The program input receives a sequence from n entire positive numbers, all numbers in the sequence are different. All pairs of various elements of the sequence are considered at a distance of no less than 4 (the difference in the indexes of the elements of the pair should be 4 or more, the order of elements in the pair is notable). It is necessary to determine the number of such steam for which the product of the elements is divided into 29.

    Description of input and output

    In the first line of the input data, the number of numbers n (4 ≤ n ≤ 1000) is set. In each of the subsequent N strings, one integer positive number is recorded that does not exceed 10,000.

    As a result, the program should output one number: the number of pairs of elements in the sequence at a distance of at least 4, in which the product of the elements is multiple 29.

    An example of input data:

    An example of output for the input data above:

    Explanation. Of the 7 given elements, taking into account the permissible distances between them, it is possible to make 6 works: 58 · 4, 58 · 1, 58 · 29, 2 · 1, 2 · 29, 3 · 29. Of these, 5 products are divided into 29.

    It is required to write an effective time and memory program to solve the described task.

    The program is considered effective in time if, with an increase in the number of source numbers N in K, the time of operation of the program increases no more than K times.

    The program is considered to be effective by memory if the memory required to store all program variables does not exceed 1 kilobyte and does not increase with increasing N.

    Maximum valuation for the correct (not containing syntax errors and gives the correct answer with any valid input data) the program, effective time and memory, is 4 points.

    The maximum assessment for the correct program, effective only in time, - 3 points.

    Maximum evaluation for the correct program that does not satisfy the requirements of efficiency - 2 points.

    You can pass one program or two task solution programs (for example, one of the programs may be less effective). If you give up two programs, then each of them will be evaluated regardless of another, the final will be a large one of the two estimates.

    Before the text of the program, be sure to briefly describe the solution algorithm. Specify the programming language used and its version.

    The work of two numbers is divided into 29, if at least one of the factors is divided into 29.

    When entering numbers, you can count the number of numbers, multiple 29, not counting the four latter. Denote them n29.

    Note for verifier. The numbers themselves, except for the four of the latter, can not be stored.

    The next part of the number will be considered as a possible right element of the desired pair.

    If the next state number is divided into 29, then the answer should be added to the number of numbers to it, not counting the four latter (including read).

    If the next state number is not divided into 29, then N29 should be added to the answer.

    To build a program effective by memory, we note that, since when processing the next input element, the values \u200b\u200bare used for four elements earlier, it is enough to store only the last four elements or information about them.

    Below is the implementation of the described algorithm program in Pascal (used version PascalaBC)

    Example 1. Program in Pascal. The program is effective in time and memory

    const s \u003d 4; (required distance between the elements)

    a: Array of Longint; (storing the last S values)

    a_: LONGINT; (next value)

    n29: LONGINT; (Number of elements divided by 29 elements, not counting the last)

    cNT: Longint; (number of searched steam)

    (Introducing first s numbers)

    for i: \u003d 1 To S DO ReadLN (A [I]);

    (Entering other values, counting the search pairs)

    for i: \u003d s + 1 to n do

    iF A MOD 29 \u003d 0 THEN N29: \u003d N29 + 1;

    iF A_ MOD 29 \u003d 0 THEN CNT: \u003d CNT + I - S

    cNT: \u003d CNT + N29;

    (Weching the elements of the auxiliary array left)

    for j: \u003d 1 to S - 1 DO A [J]: \u003d A;

    a [S]: \u003d A_ (write the current element to the end of the array)