본문 바로가기

Algorithm

(2139)
(C++) - 백준(BOJ) 6779 : Who Has Seen The Wind https://www.acmicpc.net/problem/6779 6779번: Who Has Seen The Wind The input is two non-negative integers: h, the humidity factor, followed by M, the maximum number of hours Margaret will wait for the weather balloon to return to ground. You can assume 0 ≤ h ≤ 100 and 0 < M < 240. www.acmicpc.net 📕 풀이방법 📔 입력 및 초기화 습도 h, 최대 시간 측정 M, 정답을 출력할 변수 ans를 선언 후 h,M을 입력합니다. 📔 풀이과정 주어진 함수 fomula를 수행합니다. 1. ..
(C++) - 백준(BOJ) 6696 : Too Much Water https://www.acmicpc.net/problem/6696 6696번: Too Much Water Fred Mapper is a real estate agent in Prague. Many foreign delegates participating in NATO Summit ask him to find some house for them, because they want to rent it during their stay in Prague. Some even plan to stay here for a longer time after the Summit www.acmicpc.net 수학 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. PI를 정의합니다. 시간당 물이 50평방미터씩 차지하므로 COV..
(C++) - 백준(BOJ) 6609 : 모기곱셈 https://www.acmicpc.net/problem/6609 6609번: 모기곱셈 입력은 여러 개의 테스트 케이스로 이루어져 있으며 각 테스트 케이스당 한 줄로 주어진다. 각 줄은 7개의 변수인 M, P, L, E, R, S, N이 포함되어 있으며 공백문자로 나누어져 있다. M,P,L은 각각 첫 www.acmicpc.net 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 성충모기 m, 번데기 p, 유충 l, 성충 모기 1마리당 낳는 알 개수 e, 번데기 되는 비율 r, 성충되는 비율 s, 주의 수 n을 선언 후 while loop를 수행하며 EOF까지 입력받습니다. 📔 풀이과정 n만큼 for loop를 돌며 매번 바뀌는 변수를 갱신해줍니다. 📔 정답출력 반영된 결과 m을 출력합니다. 📕 Code ..
(C++) - 백준(BOJ) 6491 : Perfection #include using namespace std; vector getDivisor(int x) { vector div; for(int i = 1; i > x; if(!x) break; cout
(C++) - 백준(BOJ) 6437 : Golf https://www.acmicpc.net/problem/6437 6437번: Golf Whoever wants to learn the game of golf has to cope with several oddities first (as with every other game that originates from Great Britain). One of them is the way to count the number of strokes a player needed to put his golf ball in a hole. There is a www.acmicpc.net 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. 정해진 par의 수 p, 실제 stroke 횟수 s, test case 번호 cn..
(C++) - 백준(BOJ) 6436 : Floppies https://www.acmicpc.net/problem/6436 6436번: Floppies In this age of Internet, on-line connections, instantaneous email, etc., there are still some people who need to work with floppy disks. John is one of those. Every evening he goes home and continues what he has been doing in his office on his private UNIX www.acmicpc.net 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 SHAR file의 크기 sz, test case번호 cnt를 선언 후 whil..
(C++) - 백준(BOJ) 6249 : TV Reports https://www.acmicpc.net/problem/6249 6249번: TV Reports The first line of the input contains three positive integers n, p, and h (separated by a space), where n (1 ≤ n,p,h ≤ 10,000) specifies the number of days you are hired for to record the headlines, p is the price of Dollar one day before you start your www.acmicpc.net 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. 정보의 수 n, 전날의 처음 달라 가격 p, 전날 달라의 최고가 h를 선언합..
(C++) - 백준(BOJ) 6190 : Another Cow Number Game https://www.acmicpc.net/problem/6190 6190번: Another Cow Number Game The cows are playing a silly number game again. Bessie is tired of losing and wants you to help her cheat. In this game, a cow supplies a number N (1 n; while(n != 1) { if(n % 2) n = 3 * n + 1; else n/=2; score++; } cout