Skip to content

Commit

Permalink
[#3] 2021.12.18 백준단계별8.기본수학 4문제
Browse files Browse the repository at this point in the history
  • Loading branch information
hyesuuou committed Dec 20, 2021
1 parent e9e7fbf commit 8730864
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Boj/기본 수학1/1193.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
x = int(input())
group = 0
a = 0
b = 0
while x > group*(group+1)/2:
group = group+1

# 해당 그룹 내에서 몇번째? -> K
k = x - (group-1) * (group) // 2

if x == 1:
print("1/1")
exit(0)

if group%2==0:
# 순방향
a = k
b = group+1-a
else:
b = k
a = group+1-b

print("%d/%d"%(a,b))
10 changes: 10 additions & 0 deletions Boj/기본 수학1/1712.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
a, b, c = map(int, input().split())

result = 0

if a + (b - c) * 2 >= a + b - c:
result = -1
print(result)
else:
result = a//(c - b) + 1
print(result)
13 changes: 13 additions & 0 deletions Boj/기본 수학1/2292.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
n = int(input())
room = 0
count = 2
while True:
if n == 1:
room = 1
break
if count > n:
break
count = count + 6*room
room = room + 1

print(room)
5 changes: 5 additions & 0 deletions Boj/기본 수학1/2869.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import math
a, b, v = map(int, input().split())
ans = math.ceil((v-b)/(a-b))

print(ans)

0 comments on commit 8730864

Please sign in to comment.