본문 바로가기

전체 글107

[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.
[2019.02.28] Utopian Tree Problem The Utopian Tree goes through 2 cycles of growth every year. Each spring, it doubles in height. Each summer, its height increases by 1 meter.Laura plants a Utopian Tree sapling with a height of 1 meter at the onset of spring. How tall will her tree be after growth cycles?For example, if the number of growth cycles is , the calculations are as follows:Period Height 0 1 1 2 2 3 3 6 4 7 5 1.. 2019. 2. 28.
[JavaScript공부 - 12] Logical operators(논리 연산자) 자바스크립트에는 세가지 논리 연산자가 있음 : || (OR 연산자), && (AND 연산자), ! (NOT 연산자) 논리적이라고 말하지만, 이 세 연산자는 boolean 타입 뿐만 아니라 어떠한 타입의 값에도 적용 가능함. 이 결과 또한 해당 타입이 될 수 있음. || (OR 연산자) OR 연산자는 두 개의 세로 선으로 나타냄 1result = a || b;cs 일반적인 프로그램에서 논리 OR 연산자는 boolean의 값을 조작하는 것을 의미했음. 만약 어떠한 값이 true면 true를 반환하고 false면 false를 반환함. 자바스크립트에서 논리 연산자는 약간 까다롭지만 강력한 연산자임! 처음에는 boolean 값으로 어떻게 이 연산자가 작동하는지 볼 필요가 있음! 1234alert( true || .. 2019. 2. 27.
[2019.02.27] Designer PDF Viewer Problem When you select a contiguous block of text in a PDF viewer, the selection is highlighted with a blue rectangle. In this PDF viewer, each word is highlighted independently. For example:In this challenge, you will be given a list of letter heights in the alphabet and a string. Using the letter heights given, determine the area of the rectangle highlight in assuming all letters are wide.For.. 2019. 2. 27.