Skip to content

Commit a96aa9a

Browse files
committed
[Bronze IV] Title: 안밖? 밖안? 계단? 역계단?, Time: 36 ms, Memory: 32412 KB -BaekjoonHub
1 parent 3f91667 commit a96aa9a

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# [Bronze IV] 안밖? 밖안? 계단? 역계단? - 28290
2+
3+
[문제 링크](https://www.acmicpc.net/problem/28290)
4+
5+
### 성능 요약
6+
7+
메모리: 32412 KB, 시간: 36 ms
8+
9+
### 분류
10+
11+
많은 조건 분기, 구현
12+
13+
### 제출 일자
14+
15+
2025년 1월 2일 16:15:16
16+
17+
### 문제 설명
18+
19+
<p>평소 리듬게임을 즐겨하는 대소고 친구들은 서로 다른 타법을 가지고 있다.</p>
20+
21+
<p>타법은 안밖, 밖안, 계단, 역계단이 있다.</p>
22+
23+
<table class="table table-bordered">
24+
<caption>문자열 항목은 각 타법에서 나올 수 있는 문자열을 의미한다.</caption>
25+
<tbody>
26+
<tr>
27+
<td><strong>타법</strong></td>
28+
<td><strong>설명</strong></td>
29+
<td><strong>문자열</strong></td>
30+
</tr>
31+
<tr>
32+
<td><strong>안밖</strong></td>
33+
<td>검지 손가락에서 새끼손가락 순서대로 키보드를 치는 방법.</td>
34+
<td>"<code>fdsajkl;</code>" 또는 "<code>jkl;fdsa</code>"</td>
35+
</tr>
36+
<tr>
37+
<td><strong>밖안</strong></td>
38+
<td>새끼손가락에서 검지 손가락 순서대로 키보드를 치는 방법.</td>
39+
<td>"<code>asdf;lkj</code>" 또는 "<code>;lkjasdf</code>"</td>
40+
</tr>
41+
<tr>
42+
<td><strong>계단</strong></td>
43+
<td>왼쪽 새끼손가락에서 오른쪽 새끼손가락 순서대로 키보드를 치는 방법.</td>
44+
<td>"<code>asdfjkl;</code>"</td>
45+
</tr>
46+
<tr>
47+
<td><strong>역계단</strong></td>
48+
<td>오른쪽 새끼손가락에서 왼쪽 새끼손가락 순서대로 키보드를 치는 방법.</td>
49+
<td>"<code>;lkjfdsa</code>"</td>
50+
</tr>
51+
</tbody>
52+
</table>
53+
54+
<p>하루는 대소고 친구가 찾아와 컴퓨터를 켠 뒤 메모장에 어떤 문자를 남겨 놓았다.</p>
55+
56+
<pre>asdfjkl;</pre>
57+
58+
<p>평소 리듬게임을 자주 하던 changwook987은 메모장에 문자를 쓴 친구가 <strong>계단 </strong>타법임을 눈치챘다.</p>
59+
60+
<p>친구의 타법을 알아보는 것이 재밌어진 changwook987은 다른 친구를 불러 메모장에 자신의 타법대로 입력해 보라고 했다.</p>
61+
62+
<p>다른 친구가 입력한 문자를 보고 무슨 타법으로 쳤는지 알아보자.</p>
63+
64+
### 입력
65+
66+
<p>길이가 8인 문자열 <mjx-container class="MathJax" jax="CHTML" style="font-size: 104.6%; position: relative;"><mjx-math class="MJX-TEX" aria-hidden="true"><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D446 TEX-I"></mjx-c></mjx-mi></mjx-math><mjx-assistive-mml unselectable="on" display="inline"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>S</mi></math></mjx-assistive-mml><span aria-hidden="true" class="no-mathjax mjx-copytext">$S$</span></mjx-container>가 주어진다. 문자열 <mjx-container class="MathJax" jax="CHTML" style="font-size: 104.6%; position: relative;"><mjx-math class="MJX-TEX" aria-hidden="true"><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D446 TEX-I"></mjx-c></mjx-mi></mjx-math><mjx-assistive-mml unselectable="on" display="inline"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>S</mi></math></mjx-assistive-mml><span aria-hidden="true" class="no-mathjax mjx-copytext">$S$</span></mjx-container>는 각 문자 <code>a</code>, <code>s</code>, <code>d</code>, <code>f</code>, <code>j</code>, <code>k</code>, <code>l</code>, <code>;</code>가 정확히 한 번씩 등장한다.</p>
67+
68+
### 출력
69+
70+
<p>출력은 입력에 따라 "<code>in-out</code>", "<code>out-in</code>", "<code>stairs</code>", "<code>reverse</code>" 중 하나를 출력한다.</p>
71+
72+
<ul>
73+
<li>입력이 <strong>안밖</strong>인 경우: <code>"in-out</code>"</li>
74+
<li>입력이 <strong>밖안</strong>인 경우: <code>"out-in</code>"</li>
75+
<li>입력이 <strong>계단</strong>인 경우: <code>"stairs</code>"</li>
76+
<li>입력이 <strong>역계단</strong>인 경우: "<code>reverse</code>"</li>
77+
</ul>
78+
79+
<p>만약 입력이 안밖, 밖안, 계단, 역계단 중 하나도 아니라면 <code>"molu"</code>를 출력한다.</p>
80+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
3+
a = sys.stdin.readline().strip()
4+
5+
if a == 'fdsajkl;' or a == 'jkl;fdsa':
6+
print("in-out")
7+
elif a == 'asdf;lkj' or a == ';lkjasdf':
8+
print("out-in")
9+
elif a == 'asdfjkl;':
10+
print("stairs")
11+
elif a == ';lkjfdsa':
12+
print("reverse")
13+
else:
14+
print("molu")
15+

0 commit comments

Comments
 (0)