문제 링크입니다: www.acmicpc.net/problem/15051
15051번: Máquina de café
A entrada consiste em 3 números, A1, A2, A3 (0 ≤ A1, A2, A3 ≤ 1000), um por linha, onde Ai representa o número de pessoas que trabalham no i-ésimo andar.
www.acmicpc.net
간단한 구현 문제였습니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
int A1, A2, A3; | |
cin >> A1 >> A2 >> A3; | |
int result = min(A2 * 2 + A3 * 4, min(A1 * 2 + A3 * 2, A1 * 4 + A2 * 2)); | |
cout << result << "\n"; | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 15080번 Every Second Counts (0) | 2021.03.19 |
---|---|
백준 15059번 Hard choice (0) | 2021.03.19 |
백준 15025번 Judging Moose (0) | 2021.03.19 |
백준 14935번 FA (0) | 2021.03.17 |
백준 14681번 사분면 고르기 (0) | 2021.03.17 |