본문 바로가기

1 Day 1 Algorithms65

[2019.03.15] Extra Long Factorials Problem The factorial of the integer , written , is defined as:Calculate and print the factorial of a given integer.For example, if , we calculate and get .Function DescriptionComplete the extraLongFactorials function in the editor below. It should print the result and return.extraLongFactorials has the following parameter(s):n: an integerNote: Factorials of can't be stored even in a long long v.. 2019. 3. 15.
[2019.03.14] Find Digits Problem An integer is a divisor of an integer if the remainder of .Given an integer, for each digit that makes up the integer determine whether it is a divisor. Count the number of divisors occurring within the integer.Note: Each digit is considered to be unique, so each occurrence of the same digit should be counted (e.g. for , is a divisor of each time it occurs so the answer is ).Function Des.. 2019. 3. 14.
[2019.03.13] Jumping on the Clouds: Revisited Problem Aerith is playing a cloud hopping game. In this game, there are sequentially numbered clouds that can be thunderheads or cumulus clouds. Her character must jump from cloud to cloud until it reaches the start again.To play, Aerith is given an array of clouds, and an energy level . She starts from and uses unit of energy to make a jump of size to cloud . If Aerith lands on a thundercloud, .. 2019. 3. 13.
[2019.03.12] Sequence Equation Problem Given a sequence of integers, where each element is distinct and satisfies . For each where , find any integer such that and print the value of on a new line.For example, assume the sequence . Each value of between and , the length of the sequence, is analyzed as follows:, so , so , so , so , so The values for are .Function DescriptionComplete the permutationEquation function in the edit.. 2019. 3. 12.
[2019.03.11] Circular Array Rotation Problem John Watson knows of an operation called a right circular rotation on an array of integers. One rotation operation moves the last array element to the first position and shifts all remaining elements right one. To test Sherlock's abilities, Watson provides Sherlock with an array of integers. Sherlock is to perform the rotation operation a number of times then determine the value of the e.. 2019. 3. 11.
[2019.03.07] Save the Prisoner! Problem A jail has a number of prisoners and a number of treats to pass out to them. Their jailer decides the fairest way to divide the treats is to seat the prisoners around a circular table in sequentially numbered chairs. A chair number will be drawn from a hat. Beginning with the prisoner in that chair, one candy will be handed to each prisoner sequentially around the table until all have be.. 2019. 3. 7.
[2019.03.06] Viral Advertisement Problem HackerLand Enterprise is adopting a new viral advertising strategy. When they launch a new product, they advertise it to exactly people on social media.On the first day, half of those people (i.e., ) like the advertisement and each shares it with of their friends. At the beginning of the second day, people receive the advertisement.Each day, of the recipients like the advertisement and w.. 2019. 3. 6.
[2019.03.05] Beautiful Days at the Movies Problem Lily likes to play games with integers. She has created a new game where she determines the difference between a number and its reverse. For instance, given the number , its reverse is . Their difference is . The number reversed is , and their difference is .She decides to apply her game to decision making. She will look at a numbered range of days and will only go to a movie on a beauti.. 2019. 3. 5.
[2019.03.04] Angry Professor Problem A Discrete Mathematics professor has a class of students. Frustrated with their lack of discipline, he decides to cancel class if fewer than some number of students are present when class starts. Arrival times go from on time () to arrived late ().Given the arrival time of each student and a threshhold number of attendees, determine if the class is canceled.Input FormatThe first line of .. 2019. 3. 4.