프린터 큐(백준)
package com.example.algorithm import java.util.LinkedList import java.util.Queue fun main(){ val testSize = readLine()!!.toInt() repeat(testSize){ val (_, location) = readLine()!!.split(' ').map { it.toInt() } val pair = readLine()!!.split(' ').map{it.toInt()} val queue: Queue = LinkedList() //큐에 추가 for((index, priority) in pair.withIndex()) { queue.add(Pair(priority,index)) } var result = 0 whi..
코딩테스트
2023. 7. 4. 16:09