Skip to content

Commit

Permalink
Merge pull request #248 from AlgoLeadMe/30-H0ngJu
Browse files Browse the repository at this point in the history
30-H0ngJu
  • Loading branch information
H0ngJu authored Oct 10, 2024
2 parents 101ebcf + 76c5682 commit 7d102be
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
18 changes: 10 additions & 8 deletions H0ngJu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
| 20μ°¨μ‹œ | 2024.06.03 | λ°±νŠΈλž˜ν‚Ή | [μŠ€νƒ€νŠΈμ™€ 링크](https://www.acmicpc.net/problem/14889) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/206 |
| 21μ°¨μ‹œ | 2024.06.07 | 그리디 | [행볡 μœ μΉ˜μ›](https://www.acmicpc.net/problem/13164) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/208 |
| 22μ°¨μ‹œ | 2024.08.06 | ν•΄μ‹œ | [μ˜μƒ](https://school.programmers.co.kr/learn/courses/30/lessons/42578) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/224 |
| 23μ°¨μ‹œ | 2024.08.10 | ν•΄μ‹œ | [λ² μŠ€νŠΈμ•¨λ²”](https://school.programmers.co.kr/learn/courses/30/lessons/42579) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/227 |
| 24μ°¨μ‹œ | 2024.08.17 | BFS | [아기상어](https://www.acmicpc.net/problem/16236) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/233 |
| 25μ°¨μ‹œ | 2024.08.17 | DFS | [μΉœκ΅¬λΉ„](https://www.acmicpc.net/problem/16562) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/234 |
| 26μ°¨μ‹œ | 2024.08.24 | 그리디 | [μ‹ μž…μ‚¬μ›](https://www.acmicpc.net/problem/1946) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/237 |
| 27μ°¨μ‹œ | 2024.08.27 | DFS | [트리의 지름](https://www.acmicpc.net/problem/1967) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/240 |
| 28μ°¨μ‹œ | 2024.09.04 | λ²¨λ§Œν¬λ“œ | [νƒ€μž„λ¨Έμ‹ ](https://www.acmicpc.net/problem/11657) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/244 |
| 29μ°¨μ‹œ | 2024.09.06 | κ΅¬ν˜„ | [ν†±λ‹ˆλ°”ν€΄](https://www.acmicpc.net/problem/14891) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/245 |
---
| 23μ°¨μ‹œ | 2024.08.10 | ν•΄μ‹œ | [λ² μŠ€νŠΈμ•¨λ²”](https://school.programmers.co.kr/learn/courses/30/lessons/42579) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/227 |
| 24μ°¨μ‹œ | 2024.08.17 | BFS | [아기상어](https://www.acmicpc.net/problem/16236) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/233 |
| 25μ°¨μ‹œ | 2024.08.17 | DFS | [μΉœκ΅¬λΉ„](https://www.acmicpc.net/problem/16562) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/234 |
| 26μ°¨μ‹œ | 2024.08.24 | 그리디 | [μ‹ μž…μ‚¬μ›](https://www.acmicpc.net/problem/1946) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/237 |
| 27μ°¨μ‹œ | 2024.08.27 | DFS | [트리의 지름](https://www.acmicpc.net/problem/1967) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/240 |
| 28μ°¨μ‹œ | 2024.09.04 | λ²¨λ§Œν¬λ“œ | [νƒ€μž„λ¨Έμ‹ ](https://www.acmicpc.net/problem/11657) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/244 |
| 29μ°¨μ‹œ | 2024.09.06 | κ΅¬ν˜„ | [ν†±λ‹ˆλ°”ν€΄](https://www.acmicpc.net/problem/14891) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/245 |
| 30μ°¨μ‹œ | 2024.09.27 | μˆ˜ν•™ | [Fly me to the Alpha Centauri](https://www.acmicpc.net/problem/1011) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/248 |

---
21 changes: 21 additions & 0 deletions H0ngJu/μˆ˜ν•™/Fly me to the Alpha Centauri.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sys

def input() : return sys.stdin.readline().rstrip()

T = int(input())

for _ in range(T):
x, y = map(int, input().split())
distance = y - x
cnt = 0

for _ in range(distance+1):
if distance <= cnt**2:
break
else:
cnt += 1

if distance <= (cnt-1)*cnt:
print((cnt-1)*2)
else:
print(cnt*2-1)

0 comments on commit 7d102be

Please sign in to comment.