본문 바로가기

분류 전체보기145

[백준] 경로 찾기 (11403)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/11403 문제 참고(플로이드 와샬) : https://6a68.tistory.com/13 문제 참고(DFS) : https://gist.github.com/jayden-lee/d7b858b63319b65ef2c8b2fef43d4f7b 문제 참고(BFS) : https://hees-dev.tistory.com/21 플로이드 와샬 import java.io.* import java.util.* var size: Int = 0 var route: Array = arrayOf() fun main() = with(BufferedReader(InputStreamReader(System.`in`))) { size = readLine().toIn.. 2020. 1. 30.
[배준] 바이러스 (2606)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/2606 문제 참고 : https://youjourney.tistory.com/132 import java.io.* import java.util.* var computerCount = 0 var graph: Array = arrayOf() val INF: Int = 100000 fun main() = with(BufferedReader(InputStreamReader(System.`in`))) { computerCount = readLine().toInt() graph = Array( computerCount + 1 ) { IntArray( computerCount + 1) } var conn = readLine().toInt() .. 2020. 1. 30.
[백준] 플로이드 (11404)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/11404 문제 참고 : https://pangsblog.tistory.com/90 import java.io.* import java.util.* val INF: Int = 100000 var graph: Array = arrayOf() var cityCount = 0 fun main() = with(BufferedReader(InputStreamReader(System.`in`))) { cityCount = readLine().toInt() var busCount = readLine().toInt() graph = Array(cityCount + 1) { IntArray( cityCount + 1 ) } for ( i in 1.... 2020. 1. 30.
[백준] 숨바꼭질 (1697)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/1697 문제 참고 : https://ggmouse.tistory.com/361 실패 인텔리제이에서는 문제 없이 작동하나, 백준사이트 채점시 런타임 에러 발생 import java.io.* import java.util.* var arr: IntArray = intArrayOf() fun main() = with(BufferedReader(InputStreamReader(System.`in`))) { val twoDots = readLine().split(" ") val start = twoDots[0].toInt() val dest = twoDots[1].toInt() arr = IntArray(dest*2 + 1) for (i i.. 2020. 1. 29.