작금의 세태에서 우리가 할 수 있는 BOJ를 푸는 행동 중 1번째 행위, 즉 행동 강령 제1.
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
"""
|
||||
1193: 분수찾기
|
||||
문제:
|
||||
무한히 큰 배열에 다음과 같은 분수들이 적혀 있다.
|
||||
|
||||
1/1 1/2 1/3 1/4 1/5 …
|
||||
2/1 2/2 2/3 2/4 … …
|
||||
3/1 3/2 3/3 … … …
|
||||
4/1 4/2 … … … …
|
||||
5/1 … … … … …
|
||||
… … … … … …
|
||||
|
||||
이와 같이 나열된 분수들을 1/1 -> 1/2 -> 2/1 -> 3/1 -> 2/2 -> … 과 같은 지그재그 순서로 차례대로 1번, 2번, 3번, 4번, 5번, … 분수라고 하자.
|
||||
|
||||
X가 주어졌을 때, X번째 분수를 구하는 프로그램을 작성하시오.
|
||||
입력:
|
||||
첫째 줄에 X(1 ≤ X ≤ 10,000,000)가 주어진다.
|
||||
출력:
|
||||
첫째 줄에 분수를 출력한다.
|
||||
"""
|
||||
"""
|
||||
TC1:
|
||||
Input:
|
||||
14
|
||||
Output:
|
||||
2/4
|
||||
"""
|
||||
8
zeta_python/completed/1065.py
Normal file
8
zeta_python/completed/1065.py
Normal file
@@ -0,0 +1,8 @@
|
||||
a = int(input())
|
||||
r = 0
|
||||
k = []
|
||||
for i in range(1, a+1):
|
||||
k = tuple(map(int, str(i)))
|
||||
if sum(k) == len(k)*(k[0] + k[-1]) / 2:
|
||||
r += 1
|
||||
print(r)
|
||||
5
zeta_python/completed/10951.py
Normal file
5
zeta_python/completed/10951.py
Normal file
@@ -0,0 +1,5 @@
|
||||
while 1:
|
||||
try:
|
||||
print(sum(map(int,input().split())))
|
||||
except EOFError:
|
||||
break
|
||||
14
zeta_python/completed/10996.py
Normal file
14
zeta_python/completed/10996.py
Normal file
@@ -0,0 +1,14 @@
|
||||
N = int(input())
|
||||
for i in range(N):
|
||||
for j in range(N):
|
||||
if j % 2 == 0:
|
||||
print("*", end='')
|
||||
else:
|
||||
print(" ", end='')
|
||||
print()
|
||||
for j in range(N):
|
||||
if j % 2 == 1:
|
||||
print("*", end='')
|
||||
else:
|
||||
print(" ", end='')
|
||||
print()
|
||||
3
zeta_python/completed/11021.py
Normal file
3
zeta_python/completed/11021.py
Normal file
@@ -0,0 +1,3 @@
|
||||
N = int(input())
|
||||
for i in range(N):
|
||||
print("Case #%s:"%(i+1), sum(map(int, input().split())))
|
||||
19
zeta_python/completed/1316.py
Normal file
19
zeta_python/completed/1316.py
Normal file
@@ -0,0 +1,19 @@
|
||||
N = int(input())
|
||||
c = 0
|
||||
for i in range(N):
|
||||
s = input()
|
||||
beforehead = s[0]
|
||||
|
||||
befores = set()
|
||||
befores.add(beforehead)
|
||||
for t in s:
|
||||
if t == beforehead:
|
||||
continue
|
||||
elif t in befores:
|
||||
break
|
||||
else:
|
||||
beforehead = t
|
||||
befores.add(t)
|
||||
else:
|
||||
c+=1
|
||||
print(c)
|
||||
7
zeta_python/completed/1330.py
Normal file
7
zeta_python/completed/1330.py
Normal file
@@ -0,0 +1,7 @@
|
||||
a,b = map(int, input().split())
|
||||
if a > b:
|
||||
print(">")
|
||||
elif a < b:
|
||||
print("<")
|
||||
else:
|
||||
print("==")
|
||||
2
zeta_python/completed/15596.py
Normal file
2
zeta_python/completed/15596.py
Normal file
@@ -0,0 +1,2 @@
|
||||
def solve(a):
|
||||
return sum(a)
|
||||
3
zeta_python/completed/2523.py
Normal file
3
zeta_python/completed/2523.py
Normal file
@@ -0,0 +1,3 @@
|
||||
N = int(input())
|
||||
for i in range(2*N-1):
|
||||
print("*"*(N-abs(N-1-i)))
|
||||
9
zeta_python/completed/2839.py
Normal file
9
zeta_python/completed/2839.py
Normal file
@@ -0,0 +1,9 @@
|
||||
N = int(input())
|
||||
a = 0
|
||||
while (N%5+5*a)%3 != 0 :
|
||||
a+=1
|
||||
|
||||
if N//5-a < 0:
|
||||
print(-1)
|
||||
else:
|
||||
print((N%5+5*a)//3 + (N//5-a))
|
||||
9
zeta_python/completed/4673.py
Normal file
9
zeta_python/completed/4673.py
Normal file
@@ -0,0 +1,9 @@
|
||||
a=set(i for i in range(1,10001))
|
||||
s = set()
|
||||
for i in range(1,10001):
|
||||
for j in str(i):
|
||||
i+=int(j)
|
||||
s.add(i)
|
||||
a = sorted(a-s)
|
||||
for i in a:
|
||||
print(i)
|
||||
8
zeta_python/completed/5622.py
Normal file
8
zeta_python/completed/5622.py
Normal file
@@ -0,0 +1,8 @@
|
||||
ss = 0
|
||||
for n in input():
|
||||
for i, s in enumerate(["ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"]):
|
||||
if n in s:
|
||||
ss += i+2+1
|
||||
|
||||
|
||||
print(ss)
|
||||
@@ -1 +0,0 @@
|
||||
1
|
||||
Reference in New Issue
Block a user