-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bronze I] Title: 달팽이는 올라가고 싶다, Time: 40 ms, Memory: 31120 KB -Baekjo…
…onHub
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# [Bronze I] 달팽이는 올라가고 싶다 - 2869 | ||
|
||
[문제 링크](https://www.acmicpc.net/problem/2869) | ||
|
||
### 성능 요약 | ||
|
||
메모리: 31120 KB, 시간: 40 ms | ||
|
||
### 분류 | ||
|
||
수학 | ||
|
||
### 제출 일자 | ||
|
||
2024년 3월 30일 18:42:58 | ||
|
||
### 문제 설명 | ||
|
||
<p>땅 위에 달팽이가 있다. 이 달팽이는 높이가 V미터인 나무 막대를 올라갈 것이다.</p> | ||
|
||
<p>달팽이는 낮에 A미터 올라갈 수 있다. 하지만, 밤에 잠을 자는 동안 B미터 미끄러진다. 또, 정상에 올라간 후에는 미끄러지지 않는다.</p> | ||
|
||
<p>달팽이가 나무 막대를 모두 올라가려면, 며칠이 걸리는지 구하는 프로그램을 작성하시오.</p> | ||
|
||
### 입력 | ||
|
||
<p>첫째 줄에 세 정수 A, B, V가 공백으로 구분되어서 주어진다. (1 ≤ B < A ≤ V ≤ 1,000,000,000)</p> | ||
|
||
### 출력 | ||
|
||
<p>첫째 줄에 달팽이가 나무 막대를 모두 올라가는데 며칠이 걸리는지 출력한다.</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import sys | ||
|
||
A, B, V = map(int, sys.stdin.readline().split()) | ||
|
||
cur_height = 0 | ||
day = 1 | ||
if A < V : | ||
day += (V-A-1) // (A-B) + 1 | ||
|
||
print(day) |