любой-язык

Varieties of the game "Bashe". Winning algorithms for the computer

Good evening. Friends, many of you have probably heard or played the game "Bashe". The essence of the game, the classic cas ... my option does not win all the time. I ask for help in the implementation of the 2nd and 3rd case. Thanks for your attention)

Translate the program from Pascal to [any-language]

The contest is over, see the results at the end of the question. I think many of you have seen questions consisting of a re ... <th>Подготовка</th> <th>Изменено</th> <th></th> </tr> </table>

How to reset an array in O(1)?

There is an array with N elements. You need to reset all the elements in the array. Naturally, you can make a loop and bypass the array-but the time spent on this operation will take O(n).

What algorithm for calculating sin or cos is used in modern languages?

I'm wondering how, for example, this algorithm is implemented in math. h: If the decomposition is in a series, then what, a ... t specifically interested in math.h, and more methods for calculating these functions used in programming language libraries.

Flow diagram of the cycle. Theory

I go through testing at a distance in cycles, according to the condition of the task, I have to write a utility with only the ... while (a < 5); Console.WriteLine(a); Console.ReadLine(); } And it will be correct?

How does the else if statement work and what is the difference from if?

How does the else if operator differ from the usual if ? Chain of operators from if-else if if (condition) statement; ... statement; if (condition) statement; if (condition) statement; Is there a difference in performance between them?

Traversing a two-dimensional array with a clockwise spiral

Competition task: There is a two-dimensional array N x N. You need to write a function that will traverse a two-dimensional ... pt in 81 bytes Thank you all very much for your participation, all comments will be taken into account for future contests.

The problem of covering a set of points with segments (or the knapsack problem)

Recently, the Yandex.Blitz competition for frontend developers ended, and I would like to analyze one problem. (Once again, t ... did not pass in time. Please help me, create a more optimal algorithm. It is important that the solution is single-threaded.

Why do I need dynamic typing?

There is a class of languages where typing is dynamic, such as JavaScript, VB, etc. As an adherent of strict typing, I do n ... nd in your head you need to remember that this variable has such and such a type, and here it changed the type to another...