(C++) - 백준(BOJ) 6975 : Deficient, Perfect, and Abundant
https://www.acmicpc.net/problem/6975 6975번: Deficient, Perfect, and Abundant Write a program that repeatedly reads a positive integer, determines if the integer is deficient, perfect, or abundant, and outputs the number along with its classification. A positive integer, n, is said to be perfect if the sum of its proper diviso www.acmicpc.net brute force문제였습니다. 📕 풀이방법 📔 입력 및 초기화 test case의 개수 t를 ..
(C++) - 백준(BOJ) 23971 : ZOAC 4
https://www.acmicpc.net/problem/23971 23971번: ZOAC 4 i행 j열 자리를 (i, j)라고 할 때, (1,1)에 참가자가 앉은 경우 다른 참가자는 (1,2), (2,1), (2,2) 자리를 제외한 나머지 자리에 앉을 수 있다. (2,2)의 경우는 (1,1)과 행 번호 및 열 번호의 차가 1보다 크 www.acmicpc.net 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 행 h, 열 w, 띄어 앉아야 하는 세로 길이 n, 띄어 앉아야 하는 가로 길이 m을 선언 후 입력해줍니다. 📔 풀이과정 가장 많이 앉는 방법은 가지런히 앉는 방법입니다. 앉은 형태를 봤을 때 가장 바깥쪽을 도형으로 그려보면 직사각형입니다. 정답은 세로에 앉은 인원 * 가로에 앉은 인원이 됩니다...
(C++) - 백준(BOJ) 6780 : Sumac Sequences
https://www.acmicpc.net/problem/6780 6780번: Sumac Sequences In a sumac sequence, t1, t2, .., tm, each term is an integer greater than or equal 0. Also, each term, starting with the third, is the difference of the preceding two terms (that is, tn+2 = tn − tn+1 for n ≥ 1). The sequence terminates at tm if tm−1 www.acmicpc.net 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. t1, t2, t2, 길이 cnt를 선언해줍니다. 2. t1, t2를 입력..