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
- 자연어처리
- AI 경진대회
- dacon
- 캐치카페
- PYTHON
- ubuntu
- Real or Not? NLP with Disaster Tweets
- 파이썬
- 백준
- gs25
- 금융문자분석경진대회
- leetcode
- 코로나19
- ChatGPT
- 프로그래머스 파이썬
- hackerrank
- 데이콘
- 맥북
- Baekjoon
- github
- programmers
- Git
- 편스토랑
- 프로그래머스
- Kaggle
- Docker
- 편스토랑 우승상품
- 더현대서울 맛집
- 우분투
- SW Expert Academy
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