Skip to content

Commit

Permalink
[Bronze I] Title: 달팽이는 올라가고 싶다, Time: 40 ms, Memory: 31120 KB -Baekjo…
Browse files Browse the repository at this point in the history
…onHub
  • Loading branch information
srlee056 committed Mar 30, 2024
1 parent e1b4781 commit 44be938
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
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>

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)

0 comments on commit 44be938

Please sign in to comment.