From efa4132c3c86d118396163b744733d9039e01eae Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Wed, 11 Jun 2025 18:35:00 +0900 Subject: [PATCH] 20250611 baekjoon python --- code_study/Baekjoon/python/11005.py | 10 ++++++++++ code_study/Baekjoon/python/1193.py | 13 +++++++++++++ code_study/Baekjoon/python/2292.py | 2 ++ code_study/Baekjoon/python/2720.py | 8 ++++++++ code_study/Baekjoon/python/2745.py | 9 +++++++++ code_study/Baekjoon/python/2869.py | 2 ++ code_study/Baekjoon/python/2903.py | 1 + 7 files changed, 45 insertions(+) create mode 100644 code_study/Baekjoon/python/11005.py create mode 100644 code_study/Baekjoon/python/1193.py create mode 100644 code_study/Baekjoon/python/2292.py create mode 100644 code_study/Baekjoon/python/2720.py create mode 100644 code_study/Baekjoon/python/2745.py create mode 100644 code_study/Baekjoon/python/2869.py create mode 100644 code_study/Baekjoon/python/2903.py diff --git a/code_study/Baekjoon/python/11005.py b/code_study/Baekjoon/python/11005.py new file mode 100644 index 0000000..6b62cb3 --- /dev/null +++ b/code_study/Baekjoon/python/11005.py @@ -0,0 +1,10 @@ +N, B = map(int, input().split()) +res = [] +while(N): + val = N%B + if val>9: + res.append(chr(val+ord('A')-10)) + else: + res.append(chr(val+ord('0'))) + N//=B +print(''.join(res[::-1])) \ No newline at end of file diff --git a/code_study/Baekjoon/python/1193.py b/code_study/Baekjoon/python/1193.py new file mode 100644 index 0000000..7833df4 --- /dev/null +++ b/code_study/Baekjoon/python/1193.py @@ -0,0 +1,13 @@ +x = int(input()) +val = ((1 + 8 * x) ** 0.5 - 1) / 2 +line = int(val) if val == int(val) else int(val) + 1 +m = int(line * (line + 1) / 2) + +if(line%2): + denum = line - m + x + num = line + 1 - denum +else: + denum = m - x + 1 + num = line + 1 - denum + +print(f"{num}/{denum}") \ No newline at end of file diff --git a/code_study/Baekjoon/python/2292.py b/code_study/Baekjoon/python/2292.py new file mode 100644 index 0000000..391865e --- /dev/null +++ b/code_study/Baekjoon/python/2292.py @@ -0,0 +1,2 @@ +x = (1+((4*int(input())-1)/3)**0.5) / 2 +print(int(x) if x==int(x) else int(x)+1) \ No newline at end of file diff --git a/code_study/Baekjoon/python/2720.py b/code_study/Baekjoon/python/2720.py new file mode 100644 index 0000000..29fd62b --- /dev/null +++ b/code_study/Baekjoon/python/2720.py @@ -0,0 +1,8 @@ +coin = [25,10,5,1] +for _ in range(int(input())): + n = int(input()) + res = [] + for c in coin: + res.append(n//c) + n%=c + print(*res) \ No newline at end of file diff --git a/code_study/Baekjoon/python/2745.py b/code_study/Baekjoon/python/2745.py new file mode 100644 index 0000000..b8f4627 --- /dev/null +++ b/code_study/Baekjoon/python/2745.py @@ -0,0 +1,9 @@ +N, B = input().split() +# res = 0 +# for n in N: +# if ord(n)>=ord('0') and ord(n)<=ord('9'): +# res = res*int(B)+ord(n)-ord('0') +# else: +# res = res*int(B)+ord(n)-ord('A')+10 +# print(res) +print(int(N,int(B))) \ No newline at end of file diff --git a/code_study/Baekjoon/python/2869.py b/code_study/Baekjoon/python/2869.py new file mode 100644 index 0000000..196f95d --- /dev/null +++ b/code_study/Baekjoon/python/2869.py @@ -0,0 +1,2 @@ +a, b, v = map(int, input().split()) +print((v-b-1)//(a-b)+1) \ No newline at end of file diff --git a/code_study/Baekjoon/python/2903.py b/code_study/Baekjoon/python/2903.py new file mode 100644 index 0000000..cc86b16 --- /dev/null +++ b/code_study/Baekjoon/python/2903.py @@ -0,0 +1 @@ +print((2**int(input())+1)**2) \ No newline at end of file