본문 바로가기

Algorithm

(2139)
(C++) - 백준(BOJ) 4909 : Judging Olympia https://www.acmicpc.net/problem/4909 4909번: Judging Olympia For years, a group of Regional Contest Directors (RCDs) of the ACM International Collegiate Programming Contest (ICPC) have been unsatisfied with the way contest submissions get ranked. The group sees it is academically wrong to emphasize the importance of www.acmicpc.net 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 일차원 배열 grades를 선언합니다. 이 후 while loop..
(C++) - 백준(BOJ) 4758 : Filling Out the Team https://www.acmicpc.net/problem/4758 4758번: Filling Out the Team For each player, you will output one line listing the positions that player can play. A player can play a position if each of their attributes is greater or equal to the minimum for weight and strength, and less than or equal to the slowest speed. If a pla www.acmicpc.net 간단한 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. while loop를 수행합니다. 2. 포지션..
(C++) - 백준(BOJ) 4714 : Lunacy https://www.acmicpc.net/problem/4714 4714번: Lunacy After several months struggling with a diet, Jack has become obsessed with the idea of weighing less. In an odd way, he finds it very comforting to think that, if he had simply had the luck to be born on a different planet, his weight could be considerably www.acmicpc.net 간단한 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. while loop를 수행합니다. 2. 지역변수 x를 선언 후 입력받..
(C++) - 백준(BOJ) 4690 : 완전 세제곱 https://www.acmicpc.net/problem/4690 4690번: 완전 세제곱 페르마의 마지막 정리는, a, b, c가 0이 아닌 정수이고, n이 2보다 큰 자연수 일 때, an = bn + cn을 만족하는 자연수 a, b, c가 존재하지 않는다는 정리이다. 이 정리는 아직 증명되지 않았다. 하지만, 완 www.acmicpc.net brute force문제였습니다. 📕 풀이방법 📔 입력 및 초기화 세제곱을 key, 그 때의 밑을 value로 하여 저장할 map변수 m을 선언합니다. 📔 풀이과정 $$a^3 = b^3 + c^3 + d ^ 3$$a,b,c값만 결정된다면 d값은 자동으로 결정됩니다. 3중 for문을 돌며 d값에 해당하는 세제곱이 존재하는지 m으로부터 찾습니다. 📔 정답출력 해당 세..
(C++) - 백준(BOJ) 4655 : Hangover https://www.acmicpc.net/problem/4655 4655번: Hangover How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overhang the www.acmicpc.net loop, if, 표준입출력을 사용해보는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. while loop를 수행합니다. 지..
(C++) - 백준(BOJ) 4635 : Speed Limit https://www.acmicpc.net/problem/4635 4635번: Speed Limit The input consists of one or more data sets. Each set starts with a line containing an integer n, 1 ≤ n ≤ 10, followed by n pairs of values, one pair per line. The first value in a pair, s, is the speed in miles per hour and the second value, t, is t www.acmicpc.net 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 log의 개수 logs를 선언 한 후 while loop를 수행하며 logs가 -1일..
(C++) - 백준(BOJ) 4632 : Copier Reduction https://www.acmicpc.net/problem/4623 4623번: Copier Reduction The input consists of one or more test cases, each of which is a single line containing four positive integers A, B, C, and D, separated by a space, representing an AxBmm image and a CxDmm piece of paper. All inputs will be less than one thousand. Followin www.acmicpc.net 자료형을 이용하는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 while loop를 수행합니다. 1. 줄여야할 이..
(C++) - 백준(BOJ) 6810 : ISBN https://www.acmicpc.net/problem/6810 6810번: ISBN The International Standard Book Number (ISBN) is a 13-digit code for identifying books. These numbers have a special property for detecting whether the number was written correctly. The 1-3-sum of a 13-digit number is calculated by multiplying the digits a www.acmicpc.net 간단한 입출력 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 마지막 세 수 a, b, c를 선언하고 입력해줍니다. 📔 정답출력 1-3 s..