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 |
Tags
- SW Expert Academy
- 편스토랑
- 프로그래머스 파이썬
- dacon
- 데이콘
- hackerrank
- Docker
- Git
- 파이썬
- PYTHON
- 캐치카페
- 금융문자분석경진대회
- ChatGPT
- Baekjoon
- ubuntu
- 백준
- 코로나19
- 편스토랑 우승상품
- leetcode
- programmers
- 더현대서울 맛집
- 맥북
- gs25
- 프로그래머스
- Real or Not? NLP with Disaster Tweets
- Kaggle
- AI 경진대회
- 우분투
- 자연어처리
- github
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 25784번 : Easy-to-Solve Expressions (Python) 본문
Programming/코딩 1일 1문제
[BaekJoon] 25784번 : Easy-to-Solve Expressions (Python)
솜씨좋은장씨 2022. 10. 14. 12:45728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Easy-to-Solve Expressions 입니다.
25784번: Easy-to-Solve Expressions
When one looks at a set of numbers, one usually wonders if there is a relationship among them? This task is more manageable if there are only three numbers. Given three distinct positive integers, you are to determine how one can be computed using the othe
www.acmicpc.net
👨🏻💻 코드 ( Solution )
def is_sum_num_exist(num1, num2, num3):
is_exist = False
if num1 == num2 + num3:
is_exist = True
elif num2 == num1 + num3:
is_exist = True
elif num3 == num1 + num2:
is_exist = True
return is_exist
def is_multiply_num_exist(num1, num2, num3):
is_exist = False
if num1 == num2 * num3:
is_exist = True
elif num2 == num1 * num3:
is_exist = True
elif num3 == num1 * num2:
is_exist = True
return is_exist
def easy_to_solve_expressions(num1, num2, num3):
answer = 3
is_sum_exist = is_sum_num_exist(
num1=num1, num2=num2, num3=num3
)
is_multiply_exist = is_multiply_num_exist(
num1=num1, num2=num2, num3=num3
)
if is_sum_exist:
answer = 1
elif is_multiply_exist:
answer = 2
return answer
if __name__ == "__main__":
num1, num2, num3 = map(int, input().split())
print(easy_to_solve_expressions(num1=num1, num2=num2, num3=num3))
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] 1284번 : 집 주소 (Python) (0) | 2022.10.16 |
---|---|
[BaekJoon] 25600번 : Triathlon (Python) (0) | 2022.10.15 |
[BaekJoon] 11943번 : 파일 옮기기 (Python) (0) | 2022.10.13 |
[BaekJoon] 8871번 : Zadanie próbne 2 (Python) (0) | 2022.10.12 |
[BaekJoon] 24309번 : РАВЕНСТВО (Python) (0) | 2022.10.11 |