diff --git "a/SWEA/SSAFY \353\214\200\353\271\204/14696.py" "b/SWEA/SSAFY \353\214\200\353\271\204/14696.py" new file mode 100644 index 0000000..e74fdda --- /dev/null +++ "b/SWEA/SSAFY \353\214\200\353\271\204/14696.py" @@ -0,0 +1,36 @@ +import sys +input = sys.stdin.readline + +n = int(input()) + +for i in range(n): + ans = "" + ar1 = list(map(int, input().split())) + ar2 = list(map(int, input().split())) + + ar1 = ar1[1:] + ar2 = ar2[1:] + + if ar1.count(4) > ar2.count(4): + print("A") + elif ar1.count(4) < ar2.count(4): + print("B") + else: + if ar1.count(3) > ar2.count(3): + print("A") + elif ar1.count(3) < ar2.count(3): + print("B") + else: + if ar1.count(2) > ar2.count(2): + print("A") + elif ar1.count(2) < ar2.count(2): + print("B") + else: + if ar1.count(1) > ar2.count(1): + print("A") + elif ar1.count(1) < ar2.count(1): + print("B") + else: + print("D") + + diff --git "a/SWEA/SSAFY \353\214\200\353\271\204/2206.py" "b/SWEA/SSAFY \353\214\200\353\271\204/2206.py" new file mode 100644 index 0000000..930675a --- /dev/null +++ "b/SWEA/SSAFY \353\214\200\353\271\204/2206.py" @@ -0,0 +1,35 @@ +dx = [1, -1, 0, 0] +dy = [0, 0, -1, 1] + +import sys +from collections import deque +input = sys.stdin.readline + +def bfs(): + q = deque() + q.append([0, 0, 1]) + visit = [[[0] * 2 for i in range(m)] for i in range(n)] + visit[0][0][1] = 1 + while q: + x, y, w = q.popleft() + if x == n - 1 and y == m - 1: + return visit[x][y][w] + for i in range(4): + nx = x + dx[i] + ny = y + dy[i] + if 0 <= nx < n and 0 <= ny < m: + if mtx[nx][ny] == 1 and w == 1: # 막히고 뚫을 수 있을때 + visit[nx][ny][0] = visit[x][y][1] + 1 + q.append([nx, ny, 0]) + elif mtx[nx][ny] == 0 and visit[nx][ny][w] == 0: # 방문 상태 확인 + visit[nx][ny][w] = visit[x][y][w] + 1 + q.append([nx, ny, w]) + return -1 + + +n, m = map(int, input().split()) +mtx = [] +for i in range(n): + mtx.append(list(map(int, list(input().strip())))) + +print(bfs()) \ No newline at end of file diff --git "a/SWEA/SSAFY \353\214\200\353\271\204/2309.py" "b/SWEA/SSAFY \353\214\200\353\271\204/2309.py" new file mode 100644 index 0000000..5905186 --- /dev/null +++ "b/SWEA/SSAFY \353\214\200\353\271\204/2309.py" @@ -0,0 +1,18 @@ +import sys +input = sys.stdin.readline + +ar = [] +for i in range(9): + ar.append(int(input())) + +for i in range(9): + tmp = ar[:] + del tmp[i] + for j in range(8): + tmp2 = tmp[:] + del tmp2[j] + if sum(tmp2) == 100: + tmp2.sort() + for k in range(7): + print(tmp2[k]) + exit() \ No newline at end of file