Dijkstra7 [백준] 상범 빌딩 (6593)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/6593 문제 참고(두번째) : https://suriisurii.tistory.com/7 실패(메모리 초과) import java.io.BufferedReader import java.io.InputStreamReader import java.util.* var L: Int = 0 var R: Int = 0 var C: Int = 0 var map: Array = arrayOf() var distance: Array = arrayOf() fun main() = with(BufferedReader(InputStreamReader(System.`in`))) { var lrc = readLine().split(" ") L = lrc[0].. 2020. 2. 20. [백준] 녹색 옷 입은 애가 젤다지? (4485)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/4485 import java.io.BufferedReader import java.io.InputStreamReader import java.util.* var n: Int = 0 var map: Array = arrayOf() var distance: Array = arrayOf() var cnt: Int = 1 val dRow: IntArray = intArrayOf(-1,1,0,0) val dCol: IntArray = intArrayOf(0,0,-1,1) fun main() = with(BufferedReader(InputStreamReader(System.`in`))) { n = readLine().toInt() while.. 2020. 2. 19. [백준] 특정한 최단 경로 (1504)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/1504 문제 참고 : https://stack07142.tistory.com/163 import java.io.BufferedReader import java.io.InputStreamReader import java.util.* import kotlin.collections.ArrayList var n: Int = 0 var e: Int = 0 var list: ArrayList = ArrayList() var distance: Array = arrayOf() class Node : Comparable { var index = 0 var cost = 0 constructor(index: Int, cost: Int) { this.i.. 2020. 2. 17. [백준] 알고스팟 (1261)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/1261 문제 참고. : https://stack07142.tistory.com/131 다익스트라(adjacency list) import java.io.BufferedReader import java.io.InputStreamReader import java.util.* val dRow: IntArray = intArrayOf(-1,1,0,0) val dCol: IntArray = intArrayOf(0,0,-1,1) var ROW: Int = 0 var COL: Int = 0 var map: Array = arrayOf() var distance: Array = arrayOf() fun main() = with(BufferedRe.. 2020. 2. 17. 이전 1 2 다음