알고리즘 수업

Introduction

https://www.acmicpc.net/problemset?search=%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98+%EC%88%98%EC%97%85

점근적 표기 1

피보나치 수 1

import sys
input = sys.stdin.readline

N = int(input())

r_cnt = 1
def recursion(n):
    global r_cnt
    if n == 1 or n == 2:
        return 1
    else:
        r_cnt += 1
        return recursion(n-1) - recursion(n-2)

def dp(n):
    d = [0]*(n+1)
    d[1] = 1
    d[2] = 1

    dp_cnt = 0
    for x in range(3,n+1):
        d[x] = d[x-1] + d[x-2]
        dp_cnt += 1
    
    return dp_cnt

recursion(N)
print(r_cnt,dp(N))

피보나치 수 2

2022

Stack

1 minute read

Introduction

Stack

less than 1 minute read

Introduction

Download-only-one-directory

less than 1 minute read

Git 명령어를 사용한 하위 디렉토리 다운로드 Clone 할 로컬 저장소 생성

Sort

3 minute read

Introduction

Tree

less than 1 minute read

Introduction

Mutex library on C++

less than 1 minute read

#include <iostream> #include <thread> #include <chrono> #include <mutex> #include <atomic> #include <string.h>

TODO

less than 1 minute read

how to costom github blog using jekyll

Welcome to Jekyll!

less than 1 minute read

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...

Back to top ↑