일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- 그래프
- Java8
- 알고리즘
- BFS
- algorithm
- lambda
- programmers
- 백트래킹
- DP
- DFS
- backtracking
- Brute-force
- back-end
- java
- 모던자바
- baekjoon
- 자바
- 스프링
- 프로그래머스
- Spring
- 네트워크
- 자료구조
- 운영체제
- kotlin
- 백준
- OS
- 코틀린
- LEVEL2
- TDD
- 프로젝트
- Today
- Total
목록kotlin (22)
요깨비's LAB
기존 그래들 설정과 문법 모양이 좀 달라서 스스로 적용하고 기록합니다. build.gradle.kts 부분 dependencies { ... testImplementation("org.springframework.restdocs:spring-restdocs-webtestclient") ... } tasks.withType { useJUnitPlatform() } tasks.test { outputs.dir(snippetsDir) } tasks.asciidoctor { inputs.dir(snippetsDir) dependsOn(tasks.test) } tasks.register("copyHTML", Copy::class) { dependsOn(tasks.findByName("asciidoctor")) f..
import java.util.* var C:Int = 0 fun main() { val scr = Scanner(System.`in`) C = scr.nextInt() val results = StringBuffer() for(i in 0 until C) { val N = scr.nextInt() val scores = mutableListOf() var total = 0 for(j in 0 until N) { val score = scr.nextInt() total += score scores.add(score) } val avg = total/N var count = 0 for(j in 0 until N) { if(scores[j] > avg) count++ } val result = String...
import java.util.* var energyBalls = mutableListOf() var N: Int = 0 var max = Int.MIN_VALUE fun main() { val scr = Scanner(System.`in`) N = scr.nextInt() for (i in 0 until N) { val element = scr.nextInt() energyBalls.add(element) } doAlgorithm(0, 0, N) println(max) } fun doAlgorithm(count: Int, value: Int, size: Int) { if (energyBalls.size == 2) { max = if (max < value) value else max return } f..
import java.util.* var N = 0 var max = Int.MIN_VALUE var min = Int.MAX_VALUE val elements = mutableListOf() val operators = mutableListOf() fun main() { val scr = Scanner(System.`in`) N = scr.nextInt() for (i in 0 until N) { val element = scr.nextInt() elements.add(element) } for (i in 0 until 4) { val operator = scr.nextInt() operators.add(operator) } doAlgorithm(1, elements[0]) println(max) pr..
import java.util.* var k = 0 var inEqualitySigns: Array? = null var visited: Array? = null var results = mutableListOf() fun main() { val scr = Scanner(System.`in`) k = scr.nextInt() visited = Array(10) { false } inEqualitySigns = Array(k) { "" } for (i in 0 until k) { val element = scr.next() inEqualitySigns!![i] = element } doAlgorithm(0, "", -1) results.sort() println(results[results.size-1])..
import java.util.* import kotlin.math.abs var max = Int.MIN_VALUE val visited = mutableListOf() var N = 0 fun main() { val scr = Scanner(System.`in`) val arr = mutableListOf() N = scr.nextInt() for(i in 0 until N) { val element = scr.nextInt() arr.add(element) visited.add(false) } for(i in 0 until N) { visited[i] = true getMax(1,i, arr, 0) visited[i] = false } println(max) } fun getMax(current:I..
말 그대로 아래 설명대로 구현하면 되는 문제였습니다. 따로 설명은 필요없을 것 같습니다. import java.util.* class Solution { fun solution(p: String): String { var answer = "" answer = doAlgorithm(p) return answer } fun doAlgorithm(p: String): String { var str = "" if (p == "") return "" var index = divideString(p) var u = getU(p, index) var v = getV(p, index) // println("u=$u v=$v") if(checkIsCorrectString(u)) { str += u str += doAlg..
import java.util.* var isComplete = false class ZeroArea( var row: Int, var col: Int, var visited: Array = Array(9) { false } ) val map = Array(9) { Array(9) { 0 } } fun main() { val scr = Scanner(System.`in`) val zeroAreas = mutableListOf() for (i in 0 until 9) { for (j in 0 until 9) { map[i][j] = scr.nextInt() if (map[i][j] == 0) { zeroAreas.add(ZeroArea(i, j)) } } } for (zeroArea in zeroAreas..