99클럽 코테 스터디 18일차 TIL + 오늘의 학습 키워드 : 스택/큐
이 코드는 대기줄을 관리하고 최대 대기 인원 수와 그 순간의 마지막 학생 번호를 추적합니다. ## Python 코드 ```python from collections import deque import sys def main(): input = sys.stdin.read data = input().splitlines() n = int(data[0]) # 대기줄에 있는 학생 수 queue = deque() max_queue_size = 0 last_student_number_at_max = -1 for i in range(1, n + 1): command = list(map(int, data[i].split())) type = command[0] if type == 1: student_number = com..
<알고리즘 문제풀이& 연습>/코딩테스트 연습
2024. 11. 15. 00:20