[백준 바킹독] 0x09 - BFS 토마토(7576)
Introduction
재귀함수를 다뤄 봅시다.
https://www.acmicpc.net/step/19
재귀함수를 배우면서 재귀함수를 배우는 문제
import sys
input = sys.stdin.readline
N = int(input())
def recursion(cnt,n):
print("____"*cnt+'"재귀함수가 뭔가요?"')
if cnt == n:
print("____"*cnt+'"재귀함수는 자기 자신을 호출하는 함수라네"')
else:
print("____"*cnt+'"잘 들어보게. 옛날옛날 한 산 꼭대기에 이세상 모든 지식을 통달한 선인이 있었어.')
print("____"*cnt+'마을 사람들은 모두 그 선인에게 수많은 질문을 했고, 모두 지혜롭게 대답해 주었지.')
print("____"*cnt+'그의 답은 대부분 옳았다고 하네. 그런데 어느 날, 그 선인에게 한 선비가 찾아와서 물었어."')
recursion(cnt+1,n)
print("____"*cnt+"라고 답변하였지.")
print("어느 한 컴퓨터공학과 학생이 유명한 교수님을 찾아가 물었다.")
recursion(0,N)
import sys
input = sys.stdin.readline
cnt = 0
def recursion(s, l, r):
global cnt
cnt += 1
if l >= r: return 1
elif s[l] != s[r]: return 0
else: return recursion(s, l+1, r-1)
def isPalindrome(s):
return recursion(s,0,len(s)-1)
T = int(input())
for _ in range(T):
string = input().rstrip("\n")
cnt = 0
print(isPalindrome(string),cnt)
재귀적인 패턴을 재귀함수로 찍는 문제
## star(3) 3x3
## star(9) 9x9
# star(3), star(3), star(3)
# star(3), X , star(3)
# star(3), star(3), star(3)
## star(27) 27x27
# star(9), star(9), star(9)
# star(9), X , star(9)
# star(9), star(9), star(9)
재귀적인 패턴을 찾아서 재귀함수로 찍는 문제
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
1167 트리의 지름
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Git 명령어를 사용한 하위 디렉토리 다운로드 Clone 할 로컬 저장소 생성
Introduction
# Fetch the submodule commits into the main repository git remote add submodule_origin git://url/to/submodule/origin git fetch submodule_origin
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Graph
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Spring Project
the page for java
가벼운 Base image를 사용
version: 3.0.0a10
WIDTH
version: 3.0.0a10
#include <iostream> #include <thread> #include <chrono> #include <mutex> #include <atomic> #include <string.h>
version: 3.0.0a10
https://cplusplus.com/reference/future/
Multithreading support was introduced in C++11.
how to costom github blog using jekyll
You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different wa...