Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- gs25
- 데이콘
- 더현대서울 맛집
- ChatGPT
- 편스토랑 우승상품
- PYTHON
- 백준
- 프로그래머스 파이썬
- 맥북
- SW Expert Academy
- Git
- dacon
- Real or Not? NLP with Disaster Tweets
- 금융문자분석경진대회
- AI 경진대회
- Baekjoon
- leetcode
- programmers
- 우분투
- ubuntu
- 코로나19
- Kaggle
- 파이썬
- 캐치카페
- Docker
- github
- hackerrank
- 자연어처리
- 편스토랑
- 프로그래머스
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 6764번 : Sounds fishy! (Python) 본문
728x90
반응형
코딩 1일 1문제! 오늘의 문제는 백준의 Sounds fishy! 입니다.
6764번: Sounds fishy!
The output is one of four possibilities. If the depth readings are increasing, then the output should be Fish Rising. If the depth readings are decreasing, then the output should be Fish Diving. If the depth readings are identical, then the output should b
www.acmicpc.net
👨🏻💻 코드 ( Solution )
def sounds_fishy(depth_info):
answer = "No Fish"
check_num = 0
for idx in range(len(depth_info)-1):
if depth_info[idx + 1] > depth_info[idx]:
check_num += 1
elif depth_info[idx + 1] < depth_info[idx]:
check_num -= 1
if len(set(depth_info)) == 1:
answer = "Fish At Constant Depth"
elif check_num == 3:
answer = "Fish Rising"
elif check_num == -3:
answer = "Fish Diving"
return answer
if __name__ == "__main__":
depth_info = []
for _ in range(4):
depth = int(input())
depth_info.append(depth)
print(sounds_fishy(depth_info=depth_info))
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 3047번 : ABC (Python) (1) | 2022.09.08 |
---|---|
[BaekJoon] 4740번 : 거울, 오! 거울 (Python) (0) | 2022.09.07 |
[BaekJoon] 2547번 : 사탕 선생 고창영 (Python) (2) | 2022.09.05 |
[BaekJoon] 4493번 : 가위 바위 보? (Python) (2) | 2022.09.04 |
[BaekJoon] 24262번 : 알고리즘 수업 - 알고리즘의 수행 시간 1 (Python) (2) | 2022.09.03 |
Comments