본문 바로가기

Algorithm

(2139)
(C++) - 백준(BOJ) 4696 : St. lves https://www.acmicpc.net/problem/4696 4696번: St. Ives Input consists of multiple data sets. Each data set consists of a line with a single floating point number number representing the numbers of wives, sacks per wife, cats per sack, and kittens per cat that Robert encountered that year. End of input is indic www.acmicpc.net 간단 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 공식을 적용할 a를 선언 후 입력받습니다. 📔 정답출력 공식을 적용한 결과..
(C++) - 백준(BOJ) 3512 : Flat https://www.acmicpc.net/problem/3512 3512번: Flat You are one of the developers of software for a real estate agency. One of the functions you are to implement is calculating different kinds of statistics for flats the agency is selling. Each flat consists of different types of rooms: bedroom, bathroom, k www.acmicpc.net 출력을 신경써야하는 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 방 종류별 크기의 합을 저장할 map 변수 sizePerType,..
(C++) - 백준(BOJ) 2712 : 미국 스타일 https://www.acmicpc.net/problem/2712 2712번: 미국 스타일 첫째 줄에 테스트 케이스의 개수 T(1 t; while(t--){ cin >> weight >> unit; printf("%.4f", getConvertedWeight()); cout
(C++) - 백준(BOJ) 24724번 : 현대모비스와 함께하는 부품 관리 https://www.acmicpc.net/problem/24724 24724번: 현대모비스와 함께하는 부품 관리 첫 번째 줄에 부품 관리 횟수를 나타내는 양의 정수 $T$가 주어진다. ($1 \le T \le 10$) 각 부품 관리에 대한 입력은 다음과 같이 주어진다. 첫 번째 줄에는 부품의 개수를 나타내는 양의 정수 $N$이 www.acmicpc.net 간단 출력문제였습니다. 📕 풀이방법 📔 입력 및 초기화 test case t, 부품 set 개수 n, 크기와 무게 제한 l1, l2, 부품 크기 무게 정보 a, b를 선언 후 적절히 입력받습니다. 📔 정답출력 형식에 맞게 출력해줍니다. 📕 Code #include using namespace std; int t, n, l1, l2, a, b; int ..
(C++) - 백준(BOJ) 10698 번 : Ahmed Aly https://www.acmicpc.net/problem/10698 10698번: Ahmed Aly Your program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1 ≤ T ≤ 100). Followed by T lines, each test case is a single line containing an equation in the following format www.acmicpc.net 간단 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 test case 수 t, a op b = res 형태의 수식을 받을 수 있도..
(C++) - 백준(BOJ) 9724 번 : Perfect Cube https://www.acmicpc.net/problem/9724 9724번: Perfect Cube A perfect cube is an integer whose cube root is also an integer. For example 1, 8, 27, 64, 125, etc. are examples of perfect cubes but 9, 25 and 113 are not. Given two positive integers A and B, your task is to calculate the number of perfect cubes in the www.acmicpc.net 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 test case t, 범위 (a, b), map m, 정답을 출력할..
(C++) - 백준(BOJ) 10395 번 : Automated Checking Machine https://www.acmicpc.net/problem/10395 10395번: Automated Checking Machine The first line contains five integers Xi (0 ≤ Xi ≤ 1 for i = 1, 2, . . . , 5), representing the connection points of the first connector in the pair. The second line contains five integers Yi (0 ≤ Yi ≤ 1 for i = 1, 2, . . . , 5), representing the c www.acmicpc.net 간단한 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 5개의 정수를 입력받을 배열 a와 정답을 출력..
(C++) - 백준(BOJ) 25377 번 : 빵 https://www.acmicpc.net/problem/25377 25377번: 빵 KOI 빵은 프로그래밍을 공부하는 학생들에게 인기를 끌고 있다. 이 빵은 맛있을 뿐 아니라, 안에 프로그래밍에 큰 도움이 되는 여러 가지 힌트가 담겨 있어서 매우 인기가 높다. 이렇게 인기가 높 www.acmicpc.net 간단 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 test case t, 가게 도착을 위한 소요시간 a, 빵이 가게에 배달오는 시간 b, 정답을 출력할 ans를 선언 후 입력받습니다. 📔 풀이과정 모든 가게를 확인하면서 빵 도착시간보다 먼저 또는 동시에 올 수 있다면 b와 ans를 비교해 최솟값을 ans에 저장합니다. 📔 정답출력 ans가 초기값이라면 빵을 살 수 없으므로 -1을 아니라면 an..