IT 썸네일형 리스트형 [백준] 균형잡힌 세상 , 쇠막대기 https://www.acmicpc.net/problem/10799fun main() = with(Scanner(System.`in`)) { val text = nextLine() val stack: Stack = Stack() var result = 0 var last: Char = ' ' for (i in text.indices) { when (text[i]) { '(' -> { stack.push(text[i]) last = text[i] } ')' -> { if (stack.isNotEmpty()) { .. [백준] N과 M https://www.acmicpc.net/problem/15649https://veggie-garden.tistory.com/24https://blog.encrypted.gg/945fun main() = with(Scanner(System.`in`)) { val maxNumber = nextInt() val count = nextInt() val arr: Array = Array(maxNumber) { 0 } val visit: Array = Array(count) { false } dfs(maxNumber, count,0, arr, visit)}fun dfs(maxNumber: Int, count: Int, depth: Int, arr: Array, visit: Array).. [백준] 패턴 https://www.acmicpc.net/status?from_problem=1&problem_id=17300 fun main() = with(Scanner(System.`in`)) { val count = nextInt() val pattern = Array(count) { 0 } for (i in 0 until count) { pattern[i] = nextInt() } val visited: Array> = arrayOf( arrayOf(false, false, false), arrayOf(false, false, false), arrayOf(false, false, false) ) println(if (fin.. [백준] 가장 긴 증가하는 부분 수열 https://www.acmicpc.net/problem/11053 fun main() = with(Scanner(System.`in`)) { val count = nextInt() val array: Array = Array(count) { 0 } for(i in 0 until count){ array[i] = nextInt() } val dp : Array = Array(count) { 1 } for(i in 1 until count){ for(j in 0 until i){ if(array[i] > array[j]){ dp[i] = max(dp[i], dp[j] + 1) } .. [백준] 좌표압축 https://www.acmicpc.net/problem/18870 fun main() = with(Scanner(System.`in`)) { val count = nextInt() val items = Array(count) { 0 } for (i in 0 until count) { items[i] = nextInt() } val results2 = items.copyOf() items.sort() val item: MutableMap = mutableMapOf() for (i in 0 until count) { if(item[items[i]] == null){ item[items[i]] = item.size .. [백준] 덩치 https://www.acmicpc.net/problem/7568 class Person(val weight: Int, val height: Int)fun main() = with(Scanner(System.`in`)) { val count = nextInt() val items = mutableListOf() val results = Array(count) { 1 } for (i in 0 until count) { val weight = nextInt() val height = nextInt() items.add(Person(weight = weight, height = height)) } for (i in 0 until items... [백준] 블랙잭 - 브루트포스 https://www.acmicpc.net/problem/2798fun main() = with(Scanner(System.`in`)) { val count = nextInt() val maxSize = nextInt() val items = arrayOfNulls(count) for (i in 0 until count) { items[i] = nextInt() } var max = 0 for (i in items.indices) { for (j in (i + 1) until items.size) { for (k in (j + 1) until items.size) { val sum = items[.. [백준] 소수찾기 https://velog.io/@changhee09/%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98-%EC%86%8C%EC%88%98%EC%9D%98-%ED%8C%90%EB%B3%84-%EC%97%90%EB%9D%BC%ED%86%A0%EC%8A%A4%ED%85%8C%EB%84%A4%EC%8A%A4%EC%9D%98-%EC%B2%B4 [알고리즘] 소수의 판별 - 에라토스테네스의 체알고리즘 - 소수의 판별velog.io 에라토스테네스를 통해 각 배수를 전부 없애면서 남은 소수를 채로 거르는 방법 이전 1 2 3 4 5 6 7 ··· 23 다음