작금의 세태에서 우리가 할 수 있는 BOJ를 푸는 행동 중 1번째 행위, 즉 행동 강령 제1.

This commit is contained in:
2020-04-23 12:49:27 +09:00
parent 1e1a687355
commit 3a718ca2ef
13 changed files with 87 additions and 28 deletions

View File

@@ -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
"""

View 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)

View File

@@ -0,0 +1,5 @@
while 1:
try:
print(sum(map(int,input().split())))
except EOFError:
break

View 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()

View File

@@ -0,0 +1,3 @@
N = int(input())
for i in range(N):
print("Case #%s:"%(i+1), sum(map(int, input().split())))

View 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)

View File

@@ -0,0 +1,7 @@
a,b = map(int, input().split())
if a > b:
print(">")
elif a < b:
print("<")
else:
print("==")

View File

@@ -0,0 +1,2 @@
def solve(a):
return sum(a)

View File

@@ -0,0 +1,3 @@
N = int(input())
for i in range(2*N-1):
print("*"*(N-abs(N-1-i)))

View 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))

View 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)

View 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)

View File

@@ -1 +0,0 @@
1