Skip to content

Commit 855492e

Browse files
committed
[Bronze IV] Title: 감마선을 맞은 컴퓨터, Time: 36 ms, Memory: 31120 KB -BaekjoonHub
1 parent 3b43058 commit 855492e

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# [Bronze IV] 감마선을 맞은 컴퓨터 - 30402
2+
3+
[문제 링크](https://www.acmicpc.net/problem/30402)
4+
5+
### 성능 요약
6+
7+
메모리: 31120 KB, 시간: 36 ms
8+
9+
### 분류
10+
11+
구현, 문자열
12+
13+
### 제출 일자
14+
15+
2024년 11월 17일 23:45:21
16+
17+
### 문제 설명
18+
19+
<p>춘배와 나비, 영철은 어느 날 지구에 나타난 UFO에게 감마선을 맞을 뻔했다. 다행히도 감마선은 행복하게 뒹굴고 있던 고양이들 옆에 있던 컴퓨터에 맞았지만, 이로 인해 컴퓨터에 저장된 춘배와 나비, 영철의 소중한 사진들의 픽셀이 모두 섞이는 사태가 발생했다! 더 이상 형체를 알아볼 수 없게 된 사진들을 보며 슬퍼하던 고양이들은 사진 복구로 유명한 전문가에게 사진의 복구를 맡기기로 했다. 자신의 사진을 다른 고양이가 보는 게 싫었던 춘배는 사진 복구를 맡기기 전에 당신에게 사진을 분류해 주는 프로그램을 만들어 달라고 부탁하였다.</p>
20+
21+
<p>프로그램은 주어진 사진이 어떤 고양이의 사진인지 구분해야 한다. 하얀색(w)이 존재한다면 춘배, 검은색(b)이 존재한다면 나비, 회색(g)이 존재한다면 영철의 사진이다. 사진은 고양이(<span style="color:#e74c3c;"><code>w</code></span>, <span style="color:#e74c3c;"><code>b</code></span>, <span style="color:#e74c3c;"><code>g</code></span>) 또는 배경(<span style="color:#e74c3c;"><code>r</code></span>, <span style="color:#e74c3c;"><code>o</code></span>, <span style="color:#e74c3c;"><code>y</code></span>, <span style="color:#e74c3c;"><code>p</code></span>)으로 이루어져 있으며 한 사진에 고양이는 무조건 1마리만 나온다.</p>
22+
23+
<table align="center" border="1" cellpadding="1" cellspacing="1" class="table table-bordered" style="width: 500px;">
24+
<tbody>
25+
<tr>
26+
<td style="text-align: center;"><img alt="" src="https://upload.acmicpc.net/418e79b5-1210-4ed5-aa61-e6a9338a743c/-/preview/"></td>
27+
<td style="text-align: center;"><img alt="" src="https://upload.acmicpc.net/91793c3d-9170-40ad-8b3d-8b95de54a4b4/-/preview/"></td>
28+
<td style="text-align: center;"><img alt="" src="https://upload.acmicpc.net/3d6bc652-62e8-4b9b-8c2a-e42344f52f8d/-/preview/"></td>
29+
</tr>
30+
<tr>
31+
<td style="text-align: center;">춘배(w)</td>
32+
<td style="text-align: center;">나비(b)</td>
33+
<td style="text-align: center;">영철(g)</td>
34+
</tr>
35+
</tbody>
36+
</table>
37+
38+
<p>입력으로 주어진 사진이 어떤 고양이의 사진인지 구분해 주자.</p>
39+
40+
### 입력
41+
42+
<p>15줄에 걸쳐 한 줄에 15개씩 섞여버린 사진의 픽셀 색이 공백으로 구분되어 주어진다.</p>
43+
44+
### 출력
45+
46+
<p>춘배의 사진이라면 <span style="color:#e74c3c;"><code>chunbae</code></span>, 나비의 사진이라면 <span style="color:#e74c3c;"><code>nabi</code></span>, 영철의 사진이라면 <span style="color:#e74c3c;"><code>yeongcheol</code></span>을 출력한다.</p>
47+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
3+
for _ in range(15):
4+
n = list(map(str, sys.stdin.readline().strip().split()))
5+
if 'w' in n:
6+
print('chunbae')
7+
break
8+
elif 'b' in n:
9+
print('nabi')
10+
break
11+
elif 'g' in n:
12+
print('yeongcheol')
13+
break
14+
else:
15+
pass

0 commit comments

Comments
 (0)