백준 10886,11279 ,1037

오성인·2023년 3월 9일
0

알고리즘

목록 보기
5/18
post-custom-banner

https://www.acmicpc.net/problem/10886

from collections import deque
n, k = map(int,input().split())
rotate_que = deque(i for i in range(1, n+1))
result = []
while len(rotate_que) > 0:
    rotate_que.rotate(-(k-1))
    result.append(rotate_que.popleft())


result = map(str, result)
answer = ', '.join(result)
print(f"<{answer}>")

https://www.acmicpc.net/problem/11279

import heapq, sys

input = sys.stdin.readline

numbers = int(input())
heap = []

for _ in range(numbers):
    num = int(input())
    if num != 0:
        heapq.heappush(heap, (-num))
    else:
        try:
            print(-1 * heapq.heappop(heap))
        except:
            print(0)

https://www.acmicpc.net/problem/1037

n = int(input())
lst = list(map(int, input().split()))
print(max(lst) * min(lst))
profile
기여하는 개발자
post-custom-banner

0개의 댓글