From 8730864c3532d42e653b1bcfc5463941107579b3 Mon Sep 17 00:00:00 2001 From: hyesuuou <68391767+hyesuuou@users.noreply.github.com> Date: Mon, 20 Dec 2021 23:33:02 +0900 Subject: [PATCH] =?UTF-8?q?[#3]=202021.12.18=20=EB=B0=B1=EC=A4=80=EB=8B=A8?= =?UTF-8?q?=EA=B3=84=EB=B3=848.=EA=B8=B0=EB=B3=B8=EC=88=98=ED=95=99=204?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1193.py" | 23 +++++++++++++++++++ .../1712.py" | 10 ++++++++ .../2292.py" | 13 +++++++++++ .../2869.py" | 5 ++++ 4 files changed, 51 insertions(+) create mode 100644 "Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/1193.py" create mode 100644 "Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/1712.py" create mode 100644 "Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/2292.py" create mode 100644 "Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/2869.py" diff --git "a/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/1193.py" "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/1193.py" new file mode 100644 index 0000000..e9b11c3 --- /dev/null +++ "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/1193.py" @@ -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)) diff --git "a/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/1712.py" "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/1712.py" new file mode 100644 index 0000000..5873b81 --- /dev/null +++ "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/1712.py" @@ -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) diff --git "a/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/2292.py" "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/2292.py" new file mode 100644 index 0000000..76392c0 --- /dev/null +++ "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/2292.py" @@ -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) \ No newline at end of file diff --git "a/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/2869.py" "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/2869.py" new file mode 100644 index 0000000..ca536e8 --- /dev/null +++ "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2311/2869.py" @@ -0,0 +1,5 @@ +import math +a, b, v = map(int, input().split()) +ans = math.ceil((v-b)/(a-b)) + +print(ans) \ No newline at end of file