top of page

소스 코드 제출

공개·회원 50명

20250816


# def 생명찾기(x,y) :
#     global a
#     l=0
#     for i in range(3):
#         for j in range(3):
#             if 24>=x-1+i>=0 and 24>=y-1+j>=0 :
#                 if a[x-1+i][y-1+j]==1 :
#                     l=l+1
#     return l
# a=[]
# for i in range(25):
#     a.append(list(map(int, input().split())))
# b=[]
# c=[]
# for i in range(25):
#     for j in range(25):
#         sum=생명찾기(i,j)
#         if a[i][j]==0 :
#             if sum==3 :
#                 b.append([i,j])
#         elif a[i][j]==1 :
#             if sum-1<=1 or sum-1>=4 :
#                 c.append([i,j])
#             elif sum-1==2 or sum-1==3 :
#                 b.append([i,j])
# for i in range(len(b)):
#     a[b[i][0]][b[i][1]]=1
# for i in range(len(c)):
#         a[c[i][0]][c[i][1]]=0
# for i in range(25):
#     for j in range(25):
#         print(a[i][j],end=' ')
#     print()
#
# # def upper_bound(x) :
# # #     global a
# # #     if x>=a[len(a)-1] :
# # #         return len(a)+1
# # #     else :
# # #         for i in range(len(a)):
# # #             if a[i]>x :
# # #                 return i+1
# # #                 break
# # # n=int(input())
# # # a=list(map(int, input().split()))
# # # k=int(input())
# # # print(upper_bound(k))

'''
재귀함수
recursive

재귀함수의 특징
1. 코드가 짧고 간단
2. 말이 되는데 왜 되는지 잘 모르겠음

재귀함수의 정의
1. 함수 내에서 자신을 다시 호출하는 함수 (ok)
2. 자신으로 다시 정의내리는 함수 (ok)



f(n) : n ~ 1 출력
     : n출력 -> n-1 ~ 1출력
     : n출력 -> f(n-1)

def f(n) :
    if n==0 : return    # 종료조건
    print(n)
    f(n-1)               # 재귀호출
f(3)

'''

# def f(x) :
#     print(x-n+1)
#     if x-n+1==n : return
#     f(x+1)
# n=int(input())
# f(n)

# def f(x) :
#     if x==0 : return
#     print(x)
#     f(x-1)
# n=int(input())
# f(n)

# def f(x,y) :
#     if x%2!=0 :
#         print(x,end=' ')
#     if x==y : return
#     f(x+1,y)
# a,b=map(int,input().split())
# f(a,b)

# import sys
# sys.setrecursionlimit(1000000)
# def f(x) :
#     if x==0 :
#         return 0
#     return x + f(x-1)
# n=int(input())
# print(f(n))

# import sys
# sys.setrecursionlimit(1000000)
# def f(x) :
#     if x==0 :
#         return 1
#     return x*f(x-1)
# n=int(input())
# print(f(n))


# memoization 메모이제이션 : 반복 줄이기 (저장해놓고쓰기)
# def f(x) :
#     global a
#     if a[x]!=0 :
#         return a[x]
#     if x==1 or x==2:
#         a[x]=1
#     else :
#         a[x] = f(x-1)+f(x-2)
#     return a[x]
# a=[0]*300
# N=int(input())
# print(f(N))


4회 조회
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546 ,     031) 215 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호
bottom of page