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

코딩 1일 1문제! 오늘의 문제는 백준의 Rats 입니다.
18301번: Rats
To celebrate the Lunar New Year of the Rat, Douglas decides to count the number of rats living in his area. It is impossible for him to find all rats, as they tend to be well hidden. However, on the first day of the new year, Douglas manages to capture n1
www.acmicpc.net
👨🏻💻 문제풀이
n1, n2, n12 를 입력 받으면
N := ⌊(n1 + 1)(n2 + 1)/(n12 + 1) - 1⌋
를 구한다음 이를 int() 로 묶어 정수로 바꾸어주면 끝! 입니다.
👨🏻💻 코드 ( Solution )
def rats(n1, n2, n12):
return int((n1+1) * (n2 + 1) / (n12 + 1) - 1)
if __name__ == "__main__":
n1, n2, n12 = map(int, input().split())
print(rats(n1, n2, n12))
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] 16468번 : 운동장 한 바퀴 (Python) (0) | 2022.06.04 |
---|---|
[BaekJoon] 14652번 : 나는 행복합니다~ (Python) (0) | 2022.06.03 |
[BaekJoon] 14623번 : 감정이입 (Python) (0) | 2022.06.01 |
[BaekJoon] 2145번 : 숫자 놀이 (Python) (0) | 2022.05.31 |
[BaekJoon] 3062번 : 수 뒤집기 (Python) (0) | 2022.05.30 |