
Difficulty : Gold V Problem Description There are 8 inputs, (W, H, f, c, x1, y1, x2, y2). There is a paper sized W*H. Fold the paper horizontally along f. Divide the paper vertically and fold it into c+1 equal parts. Paint the folded paper from (x1, y1) to (x2, y2). You have to calculate the unpainted area when you unfold the paper. Solution I calculated every cases by using conditionals. The ma..

Difficulty : Gold V Problem Description There are three numbers. If one is less than the sum of others, they are triangle. Triangular sequence is a sequence that every three elements are triangle. The input is the length of sequence 'N', and the sequence. The output is length of the longest triangular sequence that can be made up of input sequence. Solution I calculated all cases that can be mad..

Difficulty : Gold V Problem Description There are many cities, and Hyeong Taek wants to promote. Each city has the number of cost and customers. For example, if city A costs 5 to increase 3 customers, Hyeong Taek can use 15 won to increase 9 customers. You have to find out the minimum cost to increase the given number of customers. Input is C and N for the customers and the number of cities. And..

Difficulty : Silver III Problem Description There is a number. You have to make this number to 1. There are 3 ways to decrease the number. 1. If the number is divisible by 3, divide by 3. 2. If the number is divisible by 2, divide by 2. 3. decrease 1. You can use many process to make 1. The output is the smallest count to make 1. Solution As a result, all number must be divided into 2 or 3 as le..

Difficulty : Gold V Problem Description There are two plum trees. Every second,plums fall down from one of the two trees. Jadu want to get falling plums. Her health is bad so she can only move a certain number of times. Plums are falling several seconds, and Jadu want to get as maximum plums as she can move. The input is seconds, moving count, and 1 or 2 for the position of each plums in each li..

Difficulty : Gold V Problem Description There are N lines and three numbers in each line. You have to start from the first line to the last line. When you go down to the next line, you have to choose the number which is just below or right next to your below. The output is the maximum sum and the minimum sum. Solution I solved this problem by dividing the sum into three cases. The last number is..

Difficulty : Gold V Problem Description There is a city. It is N * M size and grid shape. And there are several roads under construction. You have to calculate the number of all shortest paths from (0, 0) to (N, M) except constructing roads. Solution The algorithm to calculate the problem is the number to reach (A, B) is the sum of the number of (A-1, B) and (A, B-1). N, M are the size of the ci..

Difficulty : Gold V Problem Description There is an infinite sequence. The rule of the sequence is like this. The input is N, P, Q. The output should be A(N). Solution The range of N is too large to use array, so I used hash(in python, dictionary) to solve the problem. I made a dictionary and setted the initial value (0, 1), (1, 2). If the value is calculated before, return the value. Otherwise,..

Difficulty : Gold V Problem Description There are two numbers, x and y. You have to move from x to y by using a machine. The machine can move only three distances, n-1, n, n+1. N means the last movement. For example, if you moved 5 before, now you can move 4 or 5 or 6. And when you reach y, you can only move 1. If you get x and y, you have to calculate the smallest number that you can move from ..

Difficulty: Gold V Problem Description There is a die drawing. Input is N, A, B, C, D, E, F. And you have to make N*N*N cube by using many dice. After that, the output is the sum of all numbers written on the five surfaces of the cube which can be shown. (The bottom surface cannot be shown because of the ground.) Solution I solved this problem by dividing the surface into three parts. Vertex, ed..