728x90 반응형 java129 [백준] 2812번 : 크게 만들기(JAVA) https://www.acmicpc.net/problem/2812 2812번: 크게 만들기 N자리 숫자가 주어졌을 때, 여기서 숫자 K개를 지워서 얻을 수 있는 가장 큰 수를 구하는 프로그램을 작성하시오. www.acmicpc.net 풀이 숫자의 크기와 지워야 할 숫자의 갯수를 입력받고 수를 입력받습니다. 그 수에서 지울 숫자의 갯수만큼 지웠을 경우 최대로 큰 수가 되도록 하는 문제입니다. 전 Stack을 이용하여 풀었습니다. 자바 특성상 처음 숫자의 크기(문자열의 길이)는 받을 필요없어서 넘겨주고, 지워야할 갯수를 입력받습니다. 다음 문자열의 크기만큼 반복하면서 "스택이 비어있지 않고, 지운 횟수가 지워야할 횟수보다 작고, 스택의 마지막값이 입력받은 값보다 작으면" 스택의 마지막값을 빼주고, 지운 횟수.. 2021. 8. 4. [백준] 12517, 12518, 12525, 12526번 : Centauri Prime(JAVA) https://www.acmicpc.net/problem/12517 12517번: Centauri Prime (Small1) Back in the old days before the creation of the mighty Centauri Republic, the planet Centauri Prime was split into several independent kingdoms. The kingdom of Mollaristan was ruled by king Loatold, while the kingdom of Auritania was under the rule of quee www.acmicpc.net https://www.acmicpc.net/problem/12518 12517번: Centauri .. 2021. 8. 4. [백준] 11117번 : Letter Cookies(JAVA) https://www.acmicpc.net/problem/11117 11117번: Letter Cookies The first line of the input consists of a single number T, the number of letter cookie boxes your sister has. Each test case starts with a line describing all the letters in this box, in no particular order. Then follows a line with W, the number of words www.acmicpc.net 풀이 처음에 테스트케이스 수를 입력받습니다. (문자 뒤에 공백 1칸 잇으니 주의!) 알고있는 문자열을 입력받습니다. .. 2021. 8. 3. [백준] 6721번 : Backward numbers(JAVA) https://www.acmicpc.net/problem/6721 6721번: Backward numbers Backward numbers are numbers written in ordinary Arabic numerals but the order of the digits is reversed. The first digit becomes the last, and vice versa. For example, the number 1245 becomes 5421. Note that all leading zeroes are omitted. This means that www.acmicpc.net 풀이 테스트케이스 수를 입력받고 공백을 기준으로 입력받은 수를 뒤집고 더한 값을 다시 뒤집으면 되는 문제입니다. S.. 2021. 8. 2. 이전 1 ··· 20 21 22 23 24 25 26 ··· 33 다음 728x90 반응형