[코드트리 상황을 일일이 가정해보고 진행하는 완전탐색] 야바위 Python
# n 입력 n = int(input()) # order_list order_list = [] # a, b, c 입력 for _ in range(n): order_list.append(tuple(map(int, input().split()))) # 함수들 # simulate(k) def simulate(k): # curr_cups curr_cups = [0] * 3 # 조약돌 넣기 curr_cups[k] = 1 # curr_point curr_point = 0 # simulation for i in range(n): # unpacking a, b, c = order_list[i] a, b, c = a-1, b-1, c-1 # temp_1, temp_2 temp_1, temp_2 = curr_cups[a]..
2022. 12. 26.
[코드트리 값을 기준으로 완전탐색] 데이터센터의 온도 조정 2 Python
# n, c, g, h 입력 n, c, g, h = map(int, input().split()) # preference_list preference_list = list() # preference_list 입력 for _ in range(n): preference_list.append(tuple(map(int, input().split()))) # 함수들 # calc(celcious, ta, tb) def calc(celcious, ta, tb): # 현재 온도가 ta보다 작다면 if celcious < ta: # c 반환 return c # 현재 온도가 ta이상 tb 이하라면 elif ta
2022. 12. 22.
[코드트리 물체 단위로 완전탐색] 상해버린 치즈 Python
코드 짜는거는 안어려웠는데, 문제 자체를 이해하는게 어려웠다. # N, M, D, S 입력 N, M, D, S = map(int, input().split()) # time_table time_table = [] # time_table 채우기 for _ in range(D): time_table.append(tuple(map(int, input().split()))) # sick_time sick_time = [] # sick_time 채우기 for _ in range(S): sick_time.append(tuple(map(int, input().split()))) # 함수들 # find_eaten_cheese(person, time) def find_eaten_cheese(person, time): #..
2022. 12. 20.