Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit da08173

Browse files
[Bronze IV] Title: 주사위 세개, Time: 72 ms, Memory: 30840 KB -BaekjoonHub
1 parent 0cd8c64 commit da08173

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# [Bronze IV] 주사위 세개 - 2480
2+
3+
[문제 링크](https://www.acmicpc.net/problem/2480)
4+
5+
### 성능 요약
6+
7+
메모리: 30840 KB, 시간: 72 ms
8+
9+
### 분류
10+
11+
사칙연산(arithmetic), 수학(math)
12+
13+
### 문제 설명
14+
15+
<p>1에서부터 6까지의 눈을 가진 3개의 주사위를 던져서 다음과 같은 규칙에 따라 상금을 받는 게임이 있다. </p>
16+
17+
<ol>
18+
<li>같은 눈이 3개가 나오면 10,000원+(같은 눈)×ばつ1,000원의 상금을 받게 된다. </li>
19+
<li>같은 눈이 2개만 나오는 경우에는 1,000원+(같은 눈)×ばつ100원의 상금을 받게 된다. </li>
20+
<li>모두 다른 눈이 나오는 경우에는 (그 중 가장 큰 눈)×ばつ100원의 상금을 받게 된다. </li>
21+
</ol>
22+
23+
<p>예를 들어, 3개의 눈 3, 3, 6이 주어지면 상금은 ×ばつ100으로 계산되어 1,300원을 받게 된다. 또 3개의 눈이 2, 2, 2로 주어지면 ×ばつ1,000 으로 계산되어 12,000원을 받게 된다. 3개의 눈이 6, 2, 5로 주어지면 그중 가장 큰 값이 6이므로 ×ばつ100으로 계산되어 600원을 상금으로 받게 된다.</p>
24+
25+
<p>3개 주사위의 나온 눈이 주어질 때, 상금을 계산하는 프로그램을 작성 하시오.</p>
26+
27+
### 입력
28+
29+
<p>첫째 줄에 3개의 눈이 빈칸을 사이에 두고 각각 주어진다. </p>
30+
31+
### 출력
32+
33+
<p>첫째 줄에 게임의 상금을 출력 한다.</p>
34+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 주사위 세개
2+
a, b, c = map(int, input().split())
3+
if a == b == c: ans = 10000 + a * 1000
4+
elif a == b or a == c: ans = 1000 + a * 100
5+
elif b == c: ans = 1000 + b * 100
6+
else: ans = max(a, b, c) * 100
7+
print(ans)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /