diff --git "a/choieungi/NewThisIsCT/12-1 \353\237\255\355\202\244 \354\212\244\355\212\270\353\240\210\354\235\264\355\212\270.py" "b/choieungi/NewThisIsCT/12-1 \353\237\255\355\202\244 \354\212\244\355\212\270\353\240\210\354\235\264\355\212\270.py" new file mode 100644 index 0000000..b0e080d --- /dev/null +++ "b/choieungi/NewThisIsCT/12-1 \353\237\255\355\202\244 \354\212\244\355\212\270\353\240\210\354\235\264\355\212\270.py" @@ -0,0 +1,3 @@ +s = [*map(int, input())] +l = len(s)//2 +print("READY"if sum(s[:l])-sum(s[l:])else"LUCKY") \ No newline at end of file diff --git a/choieungi/main.py b/choieungi/main.py index 5c61b3d..b0e080d 100644 --- a/choieungi/main.py +++ b/choieungi/main.py @@ -1,24 +1,3 @@ -import heapq - - -def solution(food_times, k): - if sum(food_times) <= k: return -1 - - idx_food_times = [[food, idx + 1] for idx, food in enumerate(food_times)] - heapq.heapify(idx_food_times) - previous, sum_val = 0, 0 - length = len(idx_food_times) - - while True: - if (idx_food_times[0][0] - previous) * length <= k - sum_val: - food_time = heapq.heappop(idx_food_times)[0] - sum_val += (food_time - previous) * length - previous = food_time - length -= 1 - - else: - ret = sorted(idx_food_times, key=lambda x: x[1]) - return ret[(k - sum_val) % len(idx_food_times)][1] - - -print(solution([8,6,4], 15)) \ No newline at end of file +s = [*map(int, input())] +l = len(s)//2 +print("READY"if sum(s[:l])-sum(s[l:])else"LUCKY") \ No newline at end of file