-
Kotlin π¬ λ°±μ€ 10λ¨κ³ :: 3009 λ²2023. 5. 23. 05:03λ°μν
λ€ λ²μ§Έ μ
λ¬Έμ |
μΈ μ μ΄ μ£Όμ΄μ‘μ λ, μΆμ ννν μ§μ¬κ°νμ λ§λ€κΈ° μν΄μ νμν λ€ λ²μ§Έ μ μ μ°Ύλ νλ‘κ·Έλ¨μ μμ±νμμ€.
μ λ ₯ |
μΈ μ μ μ’νκ° ν μ€μ νλμ© μ£Όμ΄μ§λ€. μ’νλ 1λ³΄λ€ ν¬κ±°λ κ°κ³ , 1000λ³΄λ€ μκ±°λ κ°μ μ μμ΄λ€.
μΆλ ₯ |
μ§μ¬κ°νμ λ€ λ²μ§Έ μ μ μ’νλ₯Ό μΆλ ₯νλ€.
νμ΄ |
xμ λ μ κ³Ό yμ λ μ μ νμ κ°μμΌ νλ μ μ μ΄μ©νλ€.
λ΅μ |
import java.util.Scanner fun main() = with(Scanner(System.`in`)) { val x1 = nextInt() val y1 = nextInt() val x2 = nextInt() val y2 = nextInt() val x3 = nextInt() val y3 = nextInt() var x4 = 0 var y4 = 0 if (x1 == x2) { x4 = x3 } else if (x1 == x3) { x4 = x2 } else if (x2 == x3) { x4 = x1 } else { println(-1) } if (y1 == y2) { y4 = y3 } else if (y1 == y3) { y4 = y2 } else if (y2 == y3) { y4 = y1 } else { println(-1) } println("$x4 $y4") }
λ°μν'π Algorithm > π λ°±μ€' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
Kotlin π¬ λ°±μ€ 10λ¨κ³ :: 9063 λ² (0) 2023.05.25 Kotlin π¬ λ°±μ€ 10λ¨κ³ :: 15894 λ² (0) 2023.05.24 Kotlin π¬ λ°±μ€ 10λ¨κ³ :: 1085 λ² (0) 2023.05.22 Kotlin π¬ λ°±μ€ 10λ¨κ³ :: 27323 λ² (0) 2023.05.21 Kotlin π¬ λ°±μ€ 9λ¨κ³ :: 11653 λ² (0) 2023.05.20