結果

問題 No.2765 Cross Product
ユーザー 👑 箱星箱星
提出日時 2024-05-31 21:21:59
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 354 ms / 2,000 ms
コード長 1,028 bytes
コンパイル時間 15,665 ms
コンパイル使用メモリ 432,252 KB
実行使用メモリ 58,632 KB
最終ジャッジ日時 2024-05-31 21:22:26
合計ジャッジ時間 24,175 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 316 ms
58,496 KB
testcase_01 AC 298 ms
58,556 KB
testcase_02 AC 296 ms
58,524 KB
testcase_03 AC 290 ms
58,560 KB
testcase_04 AC 322 ms
58,480 KB
testcase_05 AC 291 ms
58,564 KB
testcase_06 AC 322 ms
58,632 KB
testcase_07 AC 296 ms
58,404 KB
testcase_08 AC 316 ms
58,392 KB
testcase_09 AC 294 ms
58,580 KB
testcase_10 AC 294 ms
58,564 KB
testcase_11 AC 293 ms
58,544 KB
testcase_12 AC 321 ms
58,596 KB
testcase_13 AC 298 ms
58,460 KB
testcase_14 AC 321 ms
58,508 KB
testcase_15 AC 294 ms
58,500 KB
testcase_16 AC 325 ms
58,604 KB
testcase_17 AC 290 ms
58,508 KB
testcase_18 AC 306 ms
58,384 KB
testcase_19 AC 328 ms
58,608 KB
testcase_20 AC 319 ms
58,484 KB
testcase_21 AC 291 ms
58,460 KB
testcase_22 AC 327 ms
58,448 KB
testcase_23 AC 292 ms
58,388 KB
testcase_24 AC 354 ms
58,432 KB
testcase_25 AC 295 ms
58,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val ax = nextInt()
    val ay = nextInt()
    val az = nextInt()
    val bx = nextInt()
    val by = nextInt()
    val bz = nextInt()
    val cx = ay * bz - az * by
    val cy = az * bx - ax * bz
    val cz = ax * by - ay * bx
    println("$cx $cy $cz")
}

fun main() {
    Thread(null, {
        val writer = PrintWriter(System.out, false)
        writer.solve()
        writer.flush()
    }, "solve", abs(1L.shl(26)))
        .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); kotlin.system.exitProcess(1) } }
        .apply { start() }.join()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
// endregion
0