Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions week1/datastructure/N번째_큰_수/applied7076.py

This file was deleted.

14 changes: 0 additions & 14 deletions week1/datastructure/N번째_큰_수/ss721229.py

This file was deleted.

59 changes: 0 additions & 59 deletions week1/datastructure/괄호의_값/applied7076.py

This file was deleted.

37 changes: 0 additions & 37 deletions week1/datastructure/괄호의_값/ss721229.py

This file was deleted.

This file was deleted.

43 changes: 0 additions & 43 deletions week1/datastructure/문제_추천_시스템_Version_1/ss721229.py

This file was deleted.

20 changes: 0 additions & 20 deletions week1/datastructure/스택_수열/applied7076.py

This file was deleted.

34 changes: 0 additions & 34 deletions week1/datastructure/스택_수열/ss721229.py

This file was deleted.

2 changes: 2 additions & 0 deletions week1/datastructure/최대힙/sehxxnee/heap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

N=int(sys.stdin.readline().strip())



heap=[]

for i in range(N):
Expand Down
12 changes: 12 additions & 0 deletions week2/dynamic_programming/돌게임/sehxxnee/rock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys

N=int(sys.stdin.readline().strip())


if (N%2==0):
print("CY")

else:
print("SK")

#맞긴했는데... 다이나믹으로 풀어야할듯;;
31 changes: 31 additions & 0 deletions week2/dynamic_programming/선수과목/sehxxnee/Prerequisite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import sys
from collections import deque

# n이 과목의 수고 m이 선수 조건의 수
N,M=map(int,sys.stdin.readline().strip().split())
table=[[] for _ in range(N+1)]
res= [0]*(N+1)
pre = [0]* (N+1)



for _ in range (M):
#A가 B의 선수과목
A,B=map(int,sys.stdin.readline().strip().split())
table[A].append(B)
pre[B]+=1

queue=deque()
for i in range(1, N+1):
if pre[i]==0:
queue.append([i,1])

while queue:
node, cnt=queue.popleft()
res[node]=cnt
for i in table[node]:
pre[i]-=1
if pre[i]==0:
queue.append([i, cnt+1])

print(*res[1:])
25 changes: 25 additions & 0 deletions week2/dynamic_programming/합분해/sehxxnee/partition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#DP 문제-> 이전에 계산한 값을 저장해놓고 다시 계산하지 않도록 하는 기법
# -> 점화식을 구해야 한다.
#dp[k][n] = dp[k-1][0] + dp[k-1][1] + ... + dp[k-1][n]


import sys

X = 1000000000

N,K = map(int,sys.stdin.readline().strip().split())

dp = [[0] * (N + 1) for _ in range(K + 1)]

for j in range(N + 1):
dp[1][j] = 1

for i in range(2, K + 1):
for j in range(N + 1):
if j == 0:
dp[i][j] = 1
else:
dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % X


print(dp[K][N])
14 changes: 14 additions & 0 deletions week3/backtracking/sehxxnee/Blackjack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

N, M = map(int, input().split())
cards = list(map(int, input().split()))

max_sum = 0

for i in range(N):
for j in range(i + 1, N):
for k in range(j + 1, N):
total = cards[i] + cards[j] + cards[k]
if total <= M:
max_sum = max(max_sum, total)

print(max_sum)