Skip to content

1주차 - 캠핑(4796) #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 8, 2021
Merged

1주차 - 캠핑(4796) #10

merged 5 commits into from
Jun 8, 2021

Conversation

gusdn3477
Copy link
Contributor

** 📘 풀이한 문제 **
BOJ 4796번 (https://www.acmicpc.net/problem/4796)

** ⭐ 문제에서 주로 사용한 알고리즘 **
구현

** 📜 대략적인 코드 설명 **
몫과 나머지를 활용하여 풀었습니다.
처음으로 몫을 구하는 과정에서 몇 번의 주기를 도는 지에 대하여 확인하였습니다. ans 변수에 V를 P로 나눈 뒤 L을 곱한 값을 더했습니다.
나머지의 경우, 한 주기에서 최대 L의 일수 만큼만 사용 가능하므로 L을 기준으로 L보다 나머지가 작은 경우 나머지를 더하고, 크거나 같은 경우 L을 더했습니다.
또한 f string을 활용하여 출력문을 작성하였습니다.

@Heongilee Heongilee merged commit e8c424b into Heongilee:master Jun 8, 2021
@Heongilee
Copy link
Owner

늦어서 죄송합니다...! 고생하셨습니다 🙇🏻‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants