Algorithm, Data structure/Solved Algorithmic Problem 120

BAEKJOON 2703 - Cryptoquote

문제: https://www.acmicpc.net/problem/2703 문제A cryptoquote is a simple encoded message where one letter is simply replaced by another throughout the message. For example:Encoded: HPC PJVYMIYDecoded: ACM CONTESTIn the example above, H=A, P=C, C=M, J=O, V=N, Y=T, M=E and I=S. For this problem, you will decode messages.입력The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the..

BAEKJOON 2702 - Sixth Grade Math

문제: https://www.acmicpc.net/problem/2702 문제In sixth grade, students are presented with different ways to calculate the Least Common Multiple(LCM) and the Greatest Common Factor (GCF) of two integers. The LCM of two integers a and b is the smallest positive integer that is a multiple of both a and b. The GCF of two non-zero integers aand b is the largest positive integer that divides both a and b..

BAEKJOON 2700 - Interior Points of Lattice Polygons

문제: https://www.acmicpc.net/problem/2700 문제A lattice point is a point with integer coordinates. A lattice polygon is a polygon with all vertices lattice points. The lattice points on the boundary of the polygon are boundary points (open dots in the figure above) and the points inside and not on the polygon are interior points (filled in dots in the figure above). A polygon is convex if any line ..

BAEKJOON 2679 - The Next Permutation

문제: https://www.acmicpc.net/problem/2697 문제For this problem, you will write a program that takes a (possibly long) string of decimal digits, and outputs the permutation of those decimal digits that has the next larger value (as a decimal number) than the input number. For example: 123 -> 132 279134399742 -> 279134423799It is possible that no permutation of the input digits has a larger value. Fo..

BAEKJOON 2696 - Running Median

문제: https://www.acmicpc.net/problem/2696 문제For this problem, you will write a program that reads in a sequence of 32-bit signed integers. After each odd-indexed value is read, output the median (middle value) of the elements received so far. 입력The first line of input contains a single integer P, (1 ≤ P ≤ 1000), which is the number of data sets that follow. The first line of each data set contain..

BAEKJOON 2694 - Equal Sum Partitions

문제: https://www.acmicpc.net/problem/2694문제An equal sum partition of a sequence of numbers is a grouping of the numbers (in the same order as the original sequence) in such a way that each group has the same sum. For example, the sequence: 2 5 1 3 3 7 may be grouped as: (2 5) (1 3 3) (7) to yield an equal sum of 7. Note: The partition that puts all the numbers in a single group is an equal sum pa..

BAEKJOON 2693 - Nth Largest Value

문제: https://www.acmicpc.net/problem/2693 문제For this problem, you will write a program that prints the Nth largest value in a fixed sized array of integers. To make things simple, N will be 3 and the array will always be have 10 decimal integer values.입력The first line of input contains a single integer P, (1 ≤ P ≤ 1000), which is the number of data sets that follow. Each data set consists of a si..

BAEKJOON 2699 - Convex Hull of Lattice Points

문제: https://www.acmicpc.net/problem/2699 문제A lattice point is a point with integer coordinates. A lattice polygon is a polygon with all vertices lattice points. A polygon is convex if any line segment between two points of the polygon is inside (or on the boundary of) the polygon. Equivalently, the interior angle at each polygon vertex is less than 180 degrees. For a set S, of lattice points, th..

BAEKJOON 2688 - Non-Decreasing Digits

문제: https://www.acmicpc.net/problem/2688 문제A number is said to be made up of non-decreasing digits if all the digits to the left of any digit is less than or equal to that digit. For example, the four-digit number 1234 is composed of digits that are non-decreasing. Some other four-digit numbers that are composed of non-decreasing digits are 0011, 1111, 1112, 1122, 2223. As it turns out, there ar..