본문 바로가기

Algorithm/Implementation

(750)
(C++) - 백준(BOJ) 4922 : Walk Like an Egyptian https://www.acmicpc.net/problem/4922 4922번: Walk Like an Egyptian Walk Like an Egyptian is an old multi-player board game played by children of the Sahara nomad tribes. Back in the old days, children would collect stones, and number each one of them. A game with N players requires N2 stones. Each player chooses N stones. www.acmicpc.net 단순 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 while loop를 수행합니다.n, 전체 일꾼 수..
(C++) - 백준(BOJ) 4892 : 숫자 맞추기 게임 https://www.acmicpc.net/problem/4892 4892번: 숫자 맞추기 게임 입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 한 줄로 이루어져 있고, n0으로 이루어져 있다. (0 < n0 < 1,000,000) 입력의 마지막 줄에는 0이 하나 주어진다. www.acmicpc.net 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 test case 번호를 위한 변수 testNum, n0 ~ n4를 선언해줍니다. 이 후 while loop를 수행하며 n0에 처음 수를 입력해줍니다. 📔 풀이과정 1. evenString을 지역변수로 선언 후 "odd"로 초기화해줍니다. 2. 문제의 공식대로 n1 ~ n4를 구해줍니다. 도 중 n1이 짝수면 evenString에 "..
(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) 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. 줄여야할 이..