20250611 baekjoon python
This commit is contained in:
parent
4b44cdce3c
commit
efa4132c3c
10
code_study/Baekjoon/python/11005.py
Normal file
10
code_study/Baekjoon/python/11005.py
Normal file
@ -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]))
|
||||
13
code_study/Baekjoon/python/1193.py
Normal file
13
code_study/Baekjoon/python/1193.py
Normal file
@ -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}")
|
||||
2
code_study/Baekjoon/python/2292.py
Normal file
2
code_study/Baekjoon/python/2292.py
Normal file
@ -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)
|
||||
8
code_study/Baekjoon/python/2720.py
Normal file
8
code_study/Baekjoon/python/2720.py
Normal file
@ -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)
|
||||
9
code_study/Baekjoon/python/2745.py
Normal file
9
code_study/Baekjoon/python/2745.py
Normal file
@ -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)))
|
||||
2
code_study/Baekjoon/python/2869.py
Normal file
2
code_study/Baekjoon/python/2869.py
Normal file
@ -0,0 +1,2 @@
|
||||
a, b, v = map(int, input().split())
|
||||
print((v-b-1)//(a-b)+1)
|
||||
1
code_study/Baekjoon/python/2903.py
Normal file
1
code_study/Baekjoon/python/2903.py
Normal file
@ -0,0 +1 @@
|
||||
print((2**int(input())+1)**2)
|
||||
Loading…
x
Reference in New Issue
Block a user