diff --git "a/15\354\243\274\354\260\250/(P)17679/(P)17679_python_\354\265\234\353\262\224\354\244\200.py" "b/15\354\243\274\354\260\250/(P)17679/(P)17679_python_\354\265\234\353\262\224\354\244\200.py" new file mode 100644 index 0000000..e69de29 diff --git "a/17\354\243\274\354\260\250/(P)60059/(P)60059_python_\354\265\234\353\262\224\354\244\200.py" "b/17\354\243\274\354\260\250/(P)60059/(P)60059_python_\354\265\234\353\262\224\354\244\200.py" new file mode 100644 index 0000000..a90005e --- /dev/null +++ "b/17\354\243\274\354\260\250/(P)60059/(P)60059_python_\354\265\234\353\262\224\354\244\200.py" @@ -0,0 +1,19 @@ +def rotation(array, n): #array라는 2차원 배열을 시계방향으로 90도 n번 돌리는 함수 + #시계 돌리는 알고리즘을 구현을 못하겠습니다. ... + array = array + return array + +def check(key, lock): #key와 lock 각 2차원 배열이 문제 조건에 통과할 수 있는지 check하는 함수 + #통과하는 조건을 알고리즘을 구현을 못하겠습니다.. ㅜㅜ + flag = False + return flag + + +def solution(key, lock): + answer = False + + for i in range(1, 5): #시계방향으로 돌려가며 확인한다. + new_key = rotation(key, i) + answer = check(new_key, lock) + + return answer \ No newline at end of file diff --git "a/17\354\243\274\354\260\250/20055/(P)20055_python_\354\265\234\353\262\224\354\244\200.py" "b/17\354\243\274\354\260\250/20055/(P)20055_python_\354\265\234\353\262\224\354\244\200.py" new file mode 100644 index 0000000..3459160 --- /dev/null +++ "b/17\354\243\274\354\260\250/20055/(P)20055_python_\354\265\234\353\262\224\354\244\200.py" @@ -0,0 +1,31 @@ +from collections import deque + +# 로봇이 존재하는 자료구조, 벨트의 내구성을 나타내는 자료구조를 두개를 따로 사용 +n,k = map(int,input().split()) + +belt = deque(map(int,input().split())) +robot_existence = deque(list([0]*n)) #로봇은 0~n 에 존재(내리는 위치 때문에) + +result = 0 + +while belt.count(0) < k: + #한 칸씩 돌리기 + belt.rotate(1) #벨트 돌리기 + robot_existence.rotate(1) #로봇의 위치 이동 + + robot_existence[-1] = 0 #맨 마지막 로봇이 있는 자리는 내리는 칸이기에 0으로 setting + + if sum(robot_existence) > 0 : #로봇이 하나라도 존재하는 경우 + for i in range(n-2,-1,-1): + if robot_existence[i] == 1 and robot_existence[i+1] == 0 and belt[i+1]>=1: #로봇이 이동할 수 있는지 check + robot_existence[i+1] = 1 + robot_existence[i] = 0 + belt[i+1] -= 1 #내구도 1줄이기 + robot_existence[-1] = 0 #로봇이 한칸씩 이동했으므로 0을 넣어줌으로서 로봇을 내린다. + + if robot_existence[0] == 0 and belt[0]>=1: #로봇을 올리는 위치에 올려주는 역할 + robot_existence[0] = 1 + belt[0] -= 1 #내구도 1줄이기 + + result += 1 +print(result) \ No newline at end of file