전체 글 142

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..

BAEKJOON 2684 - Penney Game

문제: https://www.acmicpc.net/problem/2684 문제Penney’s game is a simple game typically played by two players. One version of the game calls for each player to choose a unique three-coin sequence such as HEADS TAILS HEADS (HTH). A fair coin is tossed sequentially some number of times until one of the two sequences appears. The player who chose the first sequence to appear wins the game.For this prob..

BAEKJOON 2679 - Route Redundancy

문제: https://www.acmicpc.net/problem/2679 문제A city is made up exclusively of one-way streets. Each street in the city has a capacity, the maximum number of cars it can carry per hour. Any route (path) also has a capacity, which is the minimum of the capacities of the streets along that route.The redundancy ratio from point A to point B is the ratio of the maximum number of cars that can get from ..

BACKJOON 2681 - Rancher's Gift

문제: https://www.acmicpc.net/problem/2681 문제Rancher Joel has a tract of land in the shape of a convex quadrilateral that he wants to divide among his sons Al, Bob, Chas and Dave, who wish to continue ranching on their portions, and his daughter Emily, who wishes to grow vegetables on her portion.The center of the tract is most suitable for vegetable farming so Joel decides to divide the land by d..